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

- Fix genhomedircon to handle root
- Fix fixfiles to better handle file system types
This commit is contained in:
Daniel J Walsh 2005-02-24 19:15:47 +00:00
parent 6723998b81
commit cc0bd43aff

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-24 13:35:56.000000000 -0500
+++ policycoreutils-1.21.19/scripts/genhomedircon 2005-02-24 14:13:15.000000000 -0500
@@ -154,13 +154,13 @@
def getDefaultHomeDir():
rc=commands.getstatusoutput("grep ^HOME= /etc/default/useradd | tail -1")
@ -48,12 +48,12 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
def heading(self):
ret = "\n#\n#\n# User-specific file contexts, generated via %s\n" % sys.argv[0]
@@ -217,11 +219,18 @@
@@ -217,11 +219,17 @@
return ret
def getUsers(self):
+ users=""
+ rc = commands.getstatusoutput('grep ^user %s' % self.getSystemUsersFile())
+ rc = commands.getstatusoutput('grep "^user" %s' % self.getSystemUsersFile())
+ if rc[0] == 0:
+ users+=rc[1]+"\n"
rc = commands.getstatusoutput("grep ^user %s" % self.getUsersFile())
@ -64,12 +64,11 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
- if rc[0] == 0:
- ulist = rc[1].strip().split("\n")
+ if users != "":
+ users+=rc[1]
+ ulist = users.split("\n")
for u in ulist:
user = u.split()
try:
@@ -254,7 +263,7 @@
@@ -254,7 +262,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"])
@ -78,7 +77,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 +294,6 @@
@@ -285,7 +293,6 @@
ret= self.heading()
for h in self.getHomeDirs():
ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user")