diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index fa2398f..3508f6b 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -70352,7 +70352,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/chcat policycore errors += chcat_add(c[1:],translate(l), objects, login_ind) diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.30.6/scripts/genhomedircon --- nsapolicycoreutils/scripts/genhomedircon 2006-02-16 13:35:28.000000000 -0500 -+++ policycoreutils-1.30.6/scripts/genhomedircon 2006-04-29 01:44:38.000000000 -0400 ++++ policycoreutils-1.30.6/scripts/genhomedircon 2006-05-07 07:04:17.000000000 -0400 @@ -26,10 +26,11 @@ import sys, os, pwd, string, getopt, re @@ -70503,7 +70503,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po if prefix == "{": prefix = user[4] if len(prefix) > 2 and (prefix[-2:] == "_r" or prefix[-2:] == "_u"): -@@ -201,7 +202,7 @@ +@@ -201,14 +202,14 @@ if home == "/": # Probably install so hard code to /root if user == "root": @@ -70512,6 +70512,14 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po else: return except KeyError: + if user == "root": + home = "/root" + else: +- sys.stderr.write("The user \"%s\" is not present in the passwd file, skipping...\n" % user) ++ sys.stderr.write(_("The user \"%s\" is not present in the passwd file, skipping...\n") % user) + return + prefs = {} + prefs["seuser"] = seuser @@ -221,22 +222,22 @@ if self.semanaged: (status, list) = semanage_seuser_list(self.semanageHandle) @@ -70594,9 +70602,10 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po + fd = open(self.getFileContextFile()) for i in fd.read().split('\n'): - if len(i)==0: -+ if len(i) == 0: - return +- return - regex=i.split()[0] ++ if len(i) == 0: ++ continue + regex = i.split()[0] #match a trailing .+ regex = re.sub("\.+$", "", regex) @@ -70612,15 +70621,17 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po return homedirs ulist = pwd.getpwall() for u in ulist: -@@ -307,7 +308,7 @@ +@@ -307,8 +308,8 @@ string.count(u[5], "/") > 1: homedir = u[5][:string.rfind(u[5], "/")] if not homedir in homedirs: - if self.checkExists(homedir)==1: +- warning("%s homedir %s or its parent directory conflicts with a\ndefined context in %s,\n%s will not create a new context." % (u[0], u[5], self.getFileContextFile(), sys.argv[0])) + if self.checkExists(homedir) == 1: - warning("%s homedir %s or its parent directory conflicts with a\ndefined context in %s,\n%s will not create a new context." % (u[0], u[5], self.getFileContextFile(), sys.argv[0])) ++ warning(_("%s homedir %s or its parent directory conflicts with a\ndefined context in %s,\n%s will not create a new context. This usually indicates an incorrectly defined system account. If it is a system account please make sure its login shell is /sbin/nologin.") % (u[0], u[5], self.getFileContextFile(), sys.argv[0])) else: homedirs.append(homedir) + @@ -316,7 +317,7 @@ return homedirs diff --git a/policycoreutils.spec b/policycoreutils.spec index 266766c..db3b8e4 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -5,7 +5,7 @@ Summary: SELinux policy core utilities. Name: policycoreutils Version: 1.30.6 -Release: 4 +Release: 5 License: GPL Group: System Environment/Base Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz @@ -110,6 +110,9 @@ rm -rf ${RPM_BUILD_ROOT} [ -x /sbin/service ] && /sbin/service restorecond condrestart %changelog +* Sun May 7 2006 Dan Walsh 1.30.6-5 +- Fix genhomedircon to catch duplicate homedir problem + * Thu May 4 2006 Dan Walsh 1.30.6-4 - Add secon program - Add translations