policycoreutils/policycoreutils-rhat.patch
Daniel J Walsh ae8bbf5a65 * Thu Apr 7 2005 Dan Walsh <dwalsh@redhat.com> 1.23.3-2
- Don't run load_policy on a non SELinux kernel.
2005-04-07 21:09:22 +00:00

28 lines
1.2 KiB
Diff

diff --exclude-from=exclude -N -u -r nsapolicycoreutils/load_policy/load_policy.c policycoreutils-1.23.3/load_policy/load_policy.c
--- nsapolicycoreutils/load_policy/load_policy.c 2005-03-01 22:58:51.000000000 -0500
+++ policycoreutils-1.23.3/load_policy/load_policy.c 2005-04-07 17:01:19.000000000 -0400
@@ -42,6 +42,11 @@
textdomain (PACKAGE);
#endif
+ if (is_selinux_enabled() <= 0 ) {
+ fprintf( stderr, "%s: Requires an enabled SELinux kernel.\n" );
+ exit(1);
+ }
+
while ((opt = getopt(argc, argv, "qb")) > 0) {
switch (opt) {
case 'b':
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecon/restorecon.c policycoreutils-1.23.3/restorecon/restorecon.c
--- nsapolicycoreutils/restorecon/restorecon.c 2005-03-08 14:03:04.000000000 -0500
+++ policycoreutils-1.23.3/restorecon/restorecon.c 2005-04-07 16:56:57.000000000 -0400
@@ -211,7 +211,7 @@
} else
if (verbose &&
(verbose > 1 || !user_only_changed))
- fprintf(stderr,"%s reset context %s:%s->%s\n",
+ fprintf(stderr,"%s reset %s context %s->%s\n",
progname, filename, (retcontext >= 0 ? prev_context : ""), scontext);
}
if (verbose > 1 && customizable>0) {