2005-02-23 14:44:50 +00:00
|
|
|
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.21.19/scripts/fixfiles
|
2005-02-19 13:19:21 +00:00
|
|
|
--- nsapolicycoreutils/scripts/fixfiles 2005-02-08 13:27:03.000000000 -0500
|
2005-02-24 19:08:17 +00:00
|
|
|
+++ policycoreutils-1.21.19/scripts/fixfiles 2005-02-24 13:32:53.000000000 -0500
|
2005-02-19 13:19:21 +00:00
|
|
|
@@ -78,8 +78,8 @@
|
2005-02-18 00:39:08 +00:00
|
|
|
esac; \
|
|
|
|
fi; \
|
|
|
|
done | \
|
2005-02-19 13:19:21 +00:00
|
|
|
- while read pattern ; do find $pattern -maxdepth 0 -print; done 2> /dev/null | \
|
|
|
|
- ${RESTORECON} -R $2 -v -e /root -e /home -e /tmp -e /var/tmp -e /dev -f -
|
2005-02-24 19:08:17 +00:00
|
|
|
+ while read pattern ; do find $pattern \( -fstype ext2 -o -fstype ext3 -o -fstype reiserfs -o -fstype xfs \) -print; done 2> /dev/null | \
|
2005-02-19 13:19:21 +00:00
|
|
|
+ ${RESTORECON} $2 -v -e /root -e /home -e /tmp -e /var/tmp -e /dev -f -
|
2005-02-18 00:39:08 +00:00
|
|
|
rm -f ${TEMPFILE}
|
|
|
|
fi
|
2005-02-19 13:19:21 +00:00
|
|
|
}
|
2005-02-23 14:44:50 +00:00
|
|
|
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.21.19/scripts/genhomedircon
|
2005-02-22 21:42:14 +00:00
|
|
|
--- nsapolicycoreutils/scripts/genhomedircon 2005-02-17 14:28:23.000000000 -0500
|
2005-02-24 19:15:47 +00:00
|
|
|
+++ policycoreutils-1.21.19/scripts/genhomedircon 2005-02-24 14:13:15.000000000 -0500
|
2005-02-23 14:44:50 +00:00
|
|
|
@@ -154,13 +154,13 @@
|
|
|
|
def getDefaultHomeDir():
|
|
|
|
rc=commands.getstatusoutput("grep ^HOME= /etc/default/useradd | tail -1")
|
|
|
|
if rc[0]==0:
|
|
|
|
- return rc[1].split("=")[-1]
|
|
|
|
+ return rc[1].split("=")[-1].strip()
|
|
|
|
return "/home"
|
|
|
|
|
|
|
|
def getSELinuxType(directory):
|
|
|
|
rc=commands.getstatusoutput("grep ^SELINUXTYPE= %s/config | tail -1" % directory)
|
|
|
|
if rc[0]==0:
|
|
|
|
- return rc[1].split("=")[-1]
|
|
|
|
+ return rc[1].split("=")[-1].strip()
|
|
|
|
return "targeted"
|
|
|
|
|
|
|
|
def usage(error = ""):
|
2005-02-24 18:23:58 +00:00
|
|
|
@@ -203,13 +203,15 @@
|
2005-02-22 21:42:14 +00:00
|
|
|
def getHomeRootContext(self, homedir):
|
|
|
|
rc=commands.getstatusoutput("grep HOME_ROOT %s | sed -e \"s|^HOME_ROOT|%s|\"" % ( self.getHomeDirTemplate(), homedir))
|
|
|
|
if rc[0] == 0:
|
|
|
|
- return rc[1]
|
|
|
|
+ return rc[1]+"\n"
|
|
|
|
else:
|
|
|
|
errorExit(string.join("sed error ", rc[1]))
|
|
|
|
|
2005-02-24 18:23:58 +00:00
|
|
|
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]
|
2005-02-24 19:15:47 +00:00
|
|
|
@@ -217,11 +219,17 @@
|
2005-02-24 18:23:58 +00:00
|
|
|
return ret
|
|
|
|
|
|
|
|
def getUsers(self):
|
|
|
|
+ users=""
|
2005-02-24 19:15:47 +00:00
|
|
|
+ rc = commands.getstatusoutput('grep "^user" %s' % self.getSystemUsersFile())
|
2005-02-24 18:23:58 +00:00
|
|
|
+ if rc[0] == 0:
|
|
|
|
+ users+=rc[1]+"\n"
|
|
|
|
rc = commands.getstatusoutput("grep ^user %s" % self.getUsersFile())
|
2005-02-24 19:08:17 +00:00
|
|
|
+ if rc[0] == 0:
|
|
|
|
+ users+=rc[1]
|
2005-02-24 18:23:58 +00:00
|
|
|
udict = {}
|
|
|
|
prefs = {}
|
2005-02-24 19:08:17 +00:00
|
|
|
- if rc[0] == 0:
|
2005-02-24 18:23:58 +00:00
|
|
|
- ulist = rc[1].strip().split("\n")
|
2005-02-24 19:08:17 +00:00
|
|
|
+ if users != "":
|
2005-02-24 18:23:58 +00:00
|
|
|
+ ulist = users.split("\n")
|
|
|
|
for u in ulist:
|
|
|
|
user = u.split()
|
|
|
|
try:
|
2005-02-24 19:15:47 +00:00
|
|
|
@@ -254,7 +262,7 @@
|
2005-02-22 21:42:14 +00:00
|
|
|
# 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"])
|
|
|
|
- return ret
|
|
|
|
+ return ret+"\n"
|
|
|
|
|
|
|
|
def checkExists(self, home):
|
|
|
|
return commands.getstatusoutput("grep -E '^%s[^[:alnum:]_-]' %s" % (home, self.getFileContextFile()))[0]
|
2005-02-24 19:15:47 +00:00
|
|
|
@@ -285,7 +293,6 @@
|
2005-02-22 21:42:14 +00:00
|
|
|
ret= self.heading()
|
|
|
|
for h in self.getHomeDirs():
|
|
|
|
ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user")
|
|
|
|
- ret += "\n"
|
|
|
|
ret += self.getHomeRootContext(h)
|
|
|
|
ret += self.genHomeDirContext()
|
|
|
|
return ret
|