* 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 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 --- 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 @@ @@ -154,13 +154,13 @@
def getDefaultHomeDir(): def getDefaultHomeDir():
rc=commands.getstatusoutput("grep ^HOME= /etc/default/useradd | tail -1") 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): def heading(self):
ret = "\n#\n#\n# User-specific file contexts, generated via %s\n" % sys.argv[0] 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 return ret
def getUsers(self): def getUsers(self):
+ users="" + users=""
+ rc = commands.getstatusoutput('grep ^user %s' % self.getSystemUsersFile()) + rc = commands.getstatusoutput('grep "^user" %s' % self.getSystemUsersFile())
+ if rc[0] == 0: + if rc[0] == 0:
+ users+=rc[1]+"\n" + users+=rc[1]+"\n"
rc = commands.getstatusoutput("grep ^user %s" % self.getUsersFile()) 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: - if rc[0] == 0:
- ulist = rc[1].strip().split("\n") - ulist = rc[1].strip().split("\n")
+ if users != "": + if users != "":
+ users+=rc[1]
+ ulist = users.split("\n") + ulist = users.split("\n")
for u in ulist: for u in ulist:
user = u.split() user = u.split()
try: try:
@@ -254,7 +263,7 @@ @@ -254,7 +262,7 @@
# Fill in HOME and ROLE for users that are defined # Fill in HOME and ROLE for users that are defined
for u in users.keys(): for u in users.keys():
ret += self.getHomeDirContext (u, users[u]["home"], users[u]["role"]) 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): def checkExists(self, home):
return commands.getstatusoutput("grep -E '^%s[^[:alnum:]_-]' %s" % (home, self.getFileContextFile()))[0] return commands.getstatusoutput("grep -E '^%s[^[:alnum:]_-]' %s" % (home, self.getFileContextFile()))[0]
@@ -285,7 +294,6 @@ @@ -285,7 +293,6 @@
ret= self.heading() ret= self.heading()
for h in self.getHomeDirs(): for h in self.getHomeDirs():
ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user") ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user")