* Thu Feb 23 2005 Dan Walsh <dwalsh@redhat.com> 1.21.19-3

- Fix genhomedircon to handle root
This commit is contained in:
Daniel J Walsh 2005-02-24 18:23:58 +00:00
parent 4202db94de
commit 8788976044
2 changed files with 34 additions and 5 deletions

View File

@ -14,7 +14,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policyc
}
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.21.19/scripts/genhomedircon
--- nsapolicycoreutils/scripts/genhomedircon 2005-02-17 14:28:23.000000000 -0500
+++ policycoreutils-1.21.19/scripts/genhomedircon 2005-02-23 09:33:26.000000000 -0500
+++ policycoreutils-1.21.19/scripts/genhomedircon 2005-02-24 13:20:09.000000000 -0500
@@ -154,13 +154,13 @@
def getDefaultHomeDir():
rc=commands.getstatusoutput("grep ^HOME= /etc/default/useradd | tail -1")
@ -31,7 +31,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
return "targeted"
def usage(error = ""):
@@ -203,7 +203,7 @@
@@ -203,13 +203,15 @@
def getHomeRootContext(self, homedir):
rc=commands.getstatusoutput("grep HOME_ROOT %s | sed -e \"s|^HOME_ROOT|%s|\"" % ( self.getHomeDirTemplate(), homedir))
if rc[0] == 0:
@ -40,7 +40,33 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
else:
errorExit(string.join("sed error ", rc[1]))
@@ -254,7 +254,7 @@
def getUsersFile(self):
return self.selinuxdir+self.type+"/users/local.users"
+ def getSystemUsersFile(self):
+ return self.selinuxdir+self.type+"/users/system.users"
def heading(self):
ret = "\n#\n#\n# User-specific file contexts, generated via %s\n" % sys.argv[0]
@@ -217,11 +219,16 @@
return ret
def getUsers(self):
+ users=""
+ rc = commands.getstatusoutput('grep "^user.*root" %s' % self.getSystemUsersFile())
+ if rc[0] == 0:
+ users+=rc[1]+"\n"
rc = commands.getstatusoutput("grep ^user %s" % self.getUsersFile())
udict = {}
prefs = {}
if rc[0] == 0:
- ulist = rc[1].strip().split("\n")
+ users+=rc[1]
+ ulist = users.split("\n")
for u in ulist:
user = u.split()
try:
@@ -254,7 +261,7 @@
# Fill in HOME and ROLE for users that are defined
for u in users.keys():
ret += self.getHomeDirContext (u, users[u]["home"], users[u]["role"])
@ -49,7 +75,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
def checkExists(self, home):
return commands.getstatusoutput("grep -E '^%s[^[:alnum:]_-]' %s" % (home, self.getFileContextFile()))[0]
@@ -285,7 +285,6 @@
@@ -285,7 +292,6 @@
ret= self.heading()
for h in self.getHomeDirs():
ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user")

View File

@ -3,7 +3,7 @@
Summary: SELinux policy core utilities.
Name: policycoreutils
Version: 1.21.19
Release: 2
Release: 3
License: GPL
Group: System Environment/Base
Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@ -82,6 +82,9 @@ rm -rf ${RPM_BUILD_ROOT}
%config(noreplace) %{_sysconfdir}/sestatus.conf
%changelog
* Thu Feb 23 2005 Dan Walsh <dwalsh@redhat.com> 1.21.19-3
- Fix genhomedircon to handle root
* Wed Feb 23 2005 Dan Walsh <dwalsh@redhat.com> 1.21.19-2
- Fix genhomedircon to handle spaces in SELINUXPOLICYTYPE