* Thu Jan 19 2006 Dan Walsh <dwalsh@redhat.com> 1.29.9-2

- Fix genhomedircon to work on MLS policy
This commit is contained in:
Daniel J Walsh 2006-01-19 22:25:24 +00:00
parent 2ef5159db8
commit 2ff281da27
2 changed files with 60 additions and 3 deletions

View File

@ -1,6 +1,6 @@
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/chcat.8 policycoreutils-1.29.8/scripts/chcat.8 diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/chcat.8 policycoreutils-1.29.9/scripts/chcat.8
--- nsapolicycoreutils/scripts/chcat.8 2006-01-18 11:12:43.000000000 -0500 --- nsapolicycoreutils/scripts/chcat.8 2006-01-18 11:12:43.000000000 -0500
+++ policycoreutils-1.29.8/scripts/chcat.8 2006-01-19 10:48:59.000000000 -0500 +++ policycoreutils-1.29.9/scripts/chcat.8 2006-01-19 17:23:42.000000000 -0500
@@ -27,6 +27,11 @@ @@ -27,6 +27,11 @@
Change/Remove the security CATEGORY for each FILE/USER. Change/Remove the security CATEGORY for each FILE/USER.
.PP .PP
@ -13,3 +13,57 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/chcat.8 policyco
.TP .TP
\fB\-d\fR \fB\-d\fR
delete the category from each FILE/USER. delete the category from each FILE/USER.
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.29.9/scripts/genhomedircon
--- nsapolicycoreutils/scripts/genhomedircon 2006-01-18 11:12:43.000000000 -0500
+++ policycoreutils-1.29.9/scripts/genhomedircon 2006-01-19 17:23:54.000000000 -0500
@@ -199,10 +199,11 @@
sys.stderr.write("The user \"%s\" is not present in the passwd file, skipping...\n" % user)
return
prefs = {}
+ prefs["seuser"] = seuser
prefs["role"] = role
prefs["home"] = home
- udict[seuser] = prefs
-
+ udict[user] = prefs
+
def getUsers(self):
udict = {}
if self.semanaged:
@@ -233,14 +234,14 @@
return udict
- def getHomeDirContext(self, user, home, role):
+ def getHomeDirContext(self, user, seuser, home, role):
ret="\n\n#\n# Home Context for user %s\n#\n\n" % user
fd=open(self.getHomeDirTemplate(), 'r')
for i in fd.read().split('\n'):
if i.startswith("HOME_DIR") == 1:
i=i.replace("HOME_DIR", home)
i=i.replace("ROLE", role)
- i=i.replace("system_u", user)
+ i=i.replace("system_u", seuser)
ret = ret+i+"\n"
fd.close()
return ret
@@ -265,8 +266,8 @@
ret=""
# 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"])
- ret += self.getUserContext (u, u, users[u]["role"])
+ ret += self.getHomeDirContext (u, users[u]["seuser"], users[u]["home"], users[u]["role"])
+ ret += self.getUserContext (u, users[u]["seuser"], users[u]["role"])
return ret+"\n"
def checkExists(self, home):
@@ -309,7 +310,7 @@
def genoutput(self):
ret= self.heading()
for h in self.getHomeDirs():
- ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user")
+ ret += self.getHomeDirContext ("user_u", "user_u" , h+'/[^/]*', "user")
ret += self.getHomeRootContext(h)
ret += self.getUserContext(".*", "user_u", "user") + "\n"
ret += self.genHomeDirContext()

View File

@ -4,7 +4,7 @@
Summary: SELinux policy core utilities. Summary: SELinux policy core utilities.
Name: policycoreutils Name: policycoreutils
Version: 1.29.9 Version: 1.29.9
Release: 1 Release: 2
License: GPL License: GPL
Group: System Environment/Base Group: System Environment/Base
Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@ -97,6 +97,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/python2.4/site-packages/seobject.py* %{_libdir}/python2.4/site-packages/seobject.py*
%changelog %changelog
* Thu Jan 19 2006 Dan Walsh <dwalsh@redhat.com> 1.29.9-2
- Fix genhomedircon to work on MLS policy
* Thu Jan 19 2006 Dan Walsh <dwalsh@redhat.com> 1.29.9-1 * Thu Jan 19 2006 Dan Walsh <dwalsh@redhat.com> 1.29.9-1
- Update to match NSA - Update to match NSA
* Merged chcat, semanage, and setsebool patches from Dan Walsh. * Merged chcat, semanage, and setsebool patches from Dan Walsh.