--- policycoreutils-1.17.3/load_policy/load_policy.c.rhat 2004-08-24 09:34:38.000000000 -0400 +++ policycoreutils-1.17.3/load_policy/load_policy.c 2004-08-25 14:30:46.343767967 -0400 @@ -19,13 +19,13 @@ void usage(char *progname) { - fprintf(stderr, _("usage: %s [-b] policyfile [booleanfile]\n"), progname); + fprintf(stderr, _("usage: %s [-q] [-b] policyfile [booleanfile]\n"), progname); exit(1); } int main(int argc, char **argv) { - int fd, ret, opt, setbools = 0, *values, len = 0, i; + int fd, ret, opt, quiet=0, setbools = 0, *values, len = 0, i; struct stat sb; void *map; char *polpath, *boolpath = NULL, **names; @@ -34,11 +34,14 @@ bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - while ((opt = getopt(argc, argv, "b")) > 0) { + while ((opt = getopt(argc, argv, "qb")) > 0) { switch (opt) { case 'b': setbools = 1; break; + case 'q': + quiet = 1; + break; default: usage(argv[0]); } @@ -81,9 +84,10 @@ if (ret < 0) { if (errno == ENOENT || errno == EINVAL) { /* No booleans file or stale booleans in the file; non-fatal. */ - fprintf(stderr, _("%s: Warning! Error while setting booleans: %s\n"), argv[0], strerror(errno)); + if (! quiet) + fprintf(stderr, _("%s: Warning! Error while setting booleans from %s: %s\n"), argv[0], boolpath, strerror(errno)); } else { - fprintf(stderr, _("%s: Error while setting booleans: %s\n"), argv[0], strerror(errno)); + fprintf(stderr, _("%s: Error while setting booleans from %s: %s\n"), argv[0], boolpath, strerror(errno)); exit(2); } } @@ -92,7 +96,8 @@ ret = security_get_boolean_names(&names, &len); if (ret) { /* Possibly ok, as there may be no booleans. */ - fprintf(stderr, _("%s: Warning! Error while getting boolean names: %s\n"), argv[0], strerror(errno)); + if (! quiet) + fprintf(stderr, _("%s: Warning! Error while getting boolean names: %s\n"), argv[0], strerror(errno)); goto load; } if (!len) @@ -113,7 +118,8 @@ if (ret < 0) { if (errno == EINVAL) { /* Stale booleans in the file; non-fatal. */ - fprintf(stderr, _("%s: Warning! Error while setting booleans: %s\n"), argv[0], strerror(errno)); + if (! quiet) + fprintf(stderr, _("%s: Warning! Error while setting booleans: %s\n"), argv[0], strerror(errno)); } else { fprintf(stderr, _("%s: Error while setting booleans: %s\n"), argv[0], strerror(errno)); exit(2); --- policycoreutils-1.17.3/load_policy/load_policy.8.rhat 2004-08-24 09:34:38.000000000 -0400 +++ policycoreutils-1.17.3/load_policy/load_policy.8 2004-08-25 14:26:40.825748466 -0400 @@ -4,13 +4,15 @@ .SH SYNOPSIS .B load_policy -[-b] policyfile [booleanfile] +[-q] [-b] policyfile [booleanfile] .br .SH DESCRIPTION .PP load_policy is the tool used to load/replace the policy in the kernel. By default, load_policy will maintain the booleans settings from the previous policy. .TP +.B -q +quiet mode. Do not report warning messages. .B -b replace the booleans settings with the ones from the [booleanfile] or the default on the system /etc/selinux/$SELINUXTYPE/booleans. (SELINUXTYPE is defined in /etc/selinux/config).