Minor improvements and clean-ups to the setfiles source code (policycoreutils): - removed unused code for undocumented and no-op "-i" option; - document syntax of "-f" option; - document syntax of "-p" option in secondary usage case (i.e. with "-s"); - substitute variable name with parameter name in usage printout for "-r" option; - remove a few misplaced spaces from the usage printout for better formatting. --- policycoreutils/setfiles/setfiles.c 2011-02-20 06:59:40.716066179 +0100 +++ policycoreutils-new/setfiles/setfiles.c 2011-02-20 09:17:49.504994923 +0100 @@ -25,7 +25,6 @@ static char *policyfile = NULL; static int warn_no_match = 0; static int null_terminated = 0; static int errors; -static int ignore_enoent; static struct restore_opts r_opts; #define STAT_BLOCK_SIZE 1 @@ -44,14 +43,15 @@ void usage(const char *const name) { if (iamrestorecon) { fprintf(stderr, - "usage: %s [-iFnrRv0] [-e excludedir ] [-o filename ] [-f filename | pathname... ]\n", + "usage: %s [-iFnrRv0] [-e excludedir] [-o filename] [-f filename | pathname...]\n", name); } else { fprintf(stderr, - "usage: %s [-dnpqvW] [-o filename] [-r alt_root_path ] spec_file pathname...\n" + "usage: %s [-dnpqvW] [-o filename] [-r alt_root_path] spec_file pathname...\n" "usage: %s -c policyfile spec_file\n" - "usage: %s -s [-dnqvW] [-o filename ] spec_file\n", name, name, - name); + "usage: %s -f filename [-dnpqvW] [-o filename] spec_file\n" + "usage: %s -s [-dnpqvW] [-o filename] spec_file\n", name, name, + name, name); } exit(1); } @@ -283,7 +283,7 @@ int main(int argc, char **argv) exclude_non_seclabel_mounts(); /* Process any options. */ - while ((opt = getopt(argc, argv, "c:de:f:ilnpqrsvo:FRW0")) > 0) { + while ((opt = getopt(argc, argv, "c:de:f:lnpqrsvo:FRW0")) > 0) { switch (opt) { case 'c': { @@ -334,9 +334,6 @@ int main(int argc, char **argv) case 'd': r_opts.debug = 1; break; - case 'i': - ignore_enoent = 1; - break; case 'l': r_opts.logging = 1; break; @@ -371,7 +368,7 @@ int main(int argc, char **argv) break; } if (optind + 1 >= argc) { - fprintf(stderr, "usage: %s -r r_opts.rootpath\n", + fprintf(stderr, "usage: %s -r rootpath\n", argv[0]); exit(1); } -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with the words "unsubscribe selinux" without quotes as the message.