chcon: exclude constraints for impossible option if long opts are off
authorDenis Vlasenko <vda.linux@googlemail.com>
Mon, 12 Mar 2007 10:41:23 +0000 (10:41 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Mon, 12 Mar 2007 10:41:23 +0000 (10:41 -0000)
selinux/chcon.c

index d7ff408160c0732073cb7fbec40f0573b0dda7c3..b7d7d5a9eb13a7477e5997d6d6c64f377856d4b1 100644 (file)
@@ -133,9 +133,12 @@ int chcon_main(int argc, char *argv[])
 #if ENABLE_FEATURE_CHCON_LONG_OPTIONS
        applet_long_options = chcon_options;
 #endif
-       opt_complementary = "-1"    /* at least 1 param */
-               ":?:f--v:v--f"      /* 'verbose' and 'quiet' are exclusive */
-               ":\xff--urtl:u--\xff:r--\xff:t--\xff:l--\xff";
+       opt_complementary = "-1"  /* at least 1 param */
+               ":?"  /* error if exclusivity constraints are violated */
+#if ENABLE_FEATURE_CHCON_LONG_OPTIONS
+               ":\xff--urtl:u--\xff:r--\xff:t--\xff:l--\xff"
+#endif
+               ":f--v:v--f";  /* 'verbose' and 'quiet' are exclusive */
        getopt32(argc, argv, "Rchf:u:r:t:l:v",
                &user, &role, &type, &range, &reference_file);
        argv += optind;