policycoreutils/policycoreutils-rhat.patch
Daniel J Walsh e4e544ece9 * Fri Feb 24 2005 Dan Walsh <dwalsh@redhat.com> 1.21.20-2
- Fix genhomedircon to handle blank users
2005-02-25 20:11:44 +00:00

44 lines
1.8 KiB
Diff

diff --exclude-from=exclude -N -u -r nsapolicycoreutils/load_policy/load_policy.c policycoreutils-1.21.20/load_policy/load_policy.c
--- nsapolicycoreutils/load_policy/load_policy.c 2005-02-22 16:37:16.000000000 -0500
+++ policycoreutils-1.21.20/load_policy/load_policy.c 2005-02-25 10:26:45.000000000 -0500
@@ -49,6 +49,7 @@
break;
case 'q':
quiet = 1;
+ sepol_debug(0);
break;
default:
usage(argv[0]);
@@ -87,7 +88,9 @@
ret = sepol_genusers(map, sb.st_size, selinux_users_path(), &data, &data_size);
if (ret < 0) {
- fprintf(stderr, _("%s: Error while setting user configuration from %s: %s\n"), argv[0], selinux_users_path(), strerror(errno));
+ /* No users file; non-fatal. */
+ if (! quiet)
+ fprintf(stderr, _("%s: Error while setting user configuration from %s/{local.users,system.users}: %s\n"), argv[0], selinux_users_path(), strerror(errno));
data = map;
data_size = sb.st_size;
}
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.21.20/scripts/genhomedircon
--- nsapolicycoreutils/scripts/genhomedircon 2005-02-25 09:16:14.000000000 -0500
+++ policycoreutils-1.21.20/scripts/genhomedircon 2005-02-25 15:08:14.183581120 -0500
@@ -222,7 +222,7 @@
users=""
rc = commands.getstatusoutput('grep "^user" %s' % self.getSystemUsersFile())
if rc[0] == 0:
- users+=rc[1]+"\n"
+ users+=rc[1]
rc = commands.getstatusoutput("grep ^user %s" % self.getUsersFile())
if rc[0] == 0:
users+=rc[1]
@@ -233,7 +233,7 @@
for u in ulist:
user = u.split()
try:
- if user[1] == "user_u" or user[1] == "system_u":
+ if len(user)==0 or user[1] == "user_u" or user[1] == "system_u":
continue
# !!! chooses first role in the list to use in the file context !!!
role = user[3]