From: José Bollo Date: Tue, 10 Dec 2013 14:33:13 +0000 (+0100) Subject: chsmack: refusing repeated labels X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72732b3b2360559e1b34401f3a416b2957e905f4;p=framework%2Fsecurity%2Fsmack.git chsmack: refusing repeated labels Refusing to set many time a label is important for security. If a label is set more than one time, wich label is to use? Wich is the good? Signed-off-by: José Bollo --- diff --git a/utils/chsmack.c b/utils/chsmack.c index 11ea2f6..b4aea3c 100644 --- a/utils/chsmack.c +++ b/utils/chsmack.c @@ -209,6 +209,11 @@ int main(int argc, char *argv[]) continue; } + if (labelset->isset) { + fprintf(stderr, "%s: %s: option set many times.\n", + basename(argv[0]), options[options_map[c]].name); + exit(1); + } /* greedy on optional arguments */ if (optarg == NULL && argv[optind] != NULL && argv[optind][0] != '-') { optarg = argv[optind++];