aboutsummaryrefslogtreecommitdiff
path: root/selinux/setfiles.c
diff options
context:
space:
mode:
Diffstat (limited to 'selinux/setfiles.c')
-rw-r--r--selinux/setfiles.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/selinux/setfiles.c b/selinux/setfiles.c
index 01106bd67..8da47d274 100644
--- a/selinux/setfiles.c
+++ b/selinux/setfiles.c
@@ -610,17 +610,23 @@ int setfiles_main(int argc UNUSED_PARAM, char **argv)
610 610
611 set_matchpathcon_flags(matchpathcon_flags); 611 set_matchpathcon_flags(matchpathcon_flags);
612 612
613 opt_complementary = "vv:v--p:p--v:v--q:q--v";
614 /* Option order must match OPT_x definitions! */ 613 /* Option order must match OPT_x definitions! */
615 if (applet_name[0] == 'r') { /* restorecon */ 614 if (applet_name[0] == 'r') { /* restorecon */
616 flags = getopt32(argv, "de:*f:ilnpqrsvo:FWR", 615 flags = getopt32(argv, "^"
617 &exclude_dir, &input_filename, &out_filename, &verbose); 616 "de:*f:ilnpqrsvo:FWR",
617 "\0" "vv:v--p:p--v:v--q:q--v";
618 &exclude_dir, &input_filename, &out_filename,
619 &verbose
620 );
618 } else { /* setfiles */ 621 } else { /* setfiles */
619 flags = getopt32(argv, "de:*f:ilnpqr:svo:FW" 622 flags = getopt32(argv, "^"
620 IF_FEATURE_SETFILES_CHECK_OPTION("c:"), 623 "de:*f:ilnpqr:svo:FW"
624 IF_FEATURE_SETFILES_CHECK_OPTION("c:"),
625 "\0" "vv:v--p:p--v:v--q:q--v";
621 &exclude_dir, &input_filename, &rootpath, &out_filename, 626 &exclude_dir, &input_filename, &rootpath, &out_filename,
622 IF_FEATURE_SETFILES_CHECK_OPTION(&policyfile,) 627 IF_FEATURE_SETFILES_CHECK_OPTION(&policyfile,)
623 &verbose); 628 &verbose
629 );
624 } 630 }
625 argv += optind; 631 argv += optind;
626 632
@@ -673,7 +679,7 @@ int setfiles_main(int argc UNUSED_PARAM, char **argv)
673 bb_show_usage(); 679 bb_show_usage();
674 xstat(argv[0], &sb); 680 xstat(argv[0], &sb);
675 if (!S_ISREG(sb.st_mode)) { 681 if (!S_ISREG(sb.st_mode)) {
676 bb_error_msg_and_die("spec file %s is not a regular file", argv[0]); 682 bb_error_msg_and_die("'%s' is not a regular file", argv[0]);
677 } 683 }
678 /* Load the file contexts configuration and check it. */ 684 /* Load the file contexts configuration and check it. */
679 rc = matchpathcon_init(argv[0]); 685 rc = matchpathcon_init(argv[0]);