* Fri Nov 11 2005 Dan Walsh <dwalsh@redhat.com> 1.27.27-3

- Patch genhomedircon to use libsemanage.py stuff
This commit is contained in:
Daniel J Walsh 2005-11-11 20:44:12 +00:00
parent 6c7ca7b42a
commit e48e95e5da
2 changed files with 12 additions and 13 deletions

View File

@ -1,6 +1,6 @@
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.27.27/scripts/genhomedircon
--- nsapolicycoreutils/scripts/genhomedircon 2005-09-12 16:33:30.000000000 -0400
+++ policycoreutils-1.27.27/scripts/genhomedircon 2005-11-11 15:11:37.000000000 -0500
+++ policycoreutils-1.27.27/scripts/genhomedircon 2005-11-11 15:43:58.000000000 -0500
@@ -15,32 +15,19 @@
# The file CONTEXTDIR/files/homedir_template exists. This file is used to
# set up the home directory context for each real user.
@ -220,7 +220,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
self.type=type
self.selinuxdir=selinuxdir +"/"
self.contextdir="/contexts"
@@ -313,47 +142,73 @@
@@ -313,47 +142,72 @@
errorExit(string.join("sed error ", rc[1]))
def getUsersFile(self):
@ -250,7 +250,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
+ else:
+ return role
+ return name
+ def adduser(self, udict, user, seuser, role, range):
+ def adduser(self, udict, user, seuser, role):
+ try:
+ if seuser == "user_u" or user == "__default__":
+ return
@ -285,14 +285,14 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
+ user=[]
+ seuser = semanage_seuser_by_idx(list, idx)
+ seusername=semanage_seuser_get_sename(seuser)
+ self.adduser(udict, semanage_seuser_get_name(seuser), seusername, self.defaultrole(seusername), semanage_seuser_get_mlsrange(seuser))
+ self.adduser(udict, semanage_seuser_get_name(seuser), seusername, self.defaultrole(seusername))
+
+ else:
+ users=""
+ rc = commands.getstatusoutput("grep -v '^ *#' %s" % self.getUsersFile())
+ if rc[0] == 0 and rc[1] != "":
+ ulist = rc[1].split("\n")
+
+ print ulist
for u in ulist:
- user = u.split()
- try:
@ -317,16 +317,15 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
+ user = u.split(":")
+ if len(user) < 3:
+ continue
+ if u[0] == "root":
+ if user[0] == "root":
+ role="user"
+ else:
+ role=u[0]
+ self.adduser(udict, u[0], u[1], role, u[2])
+
+ role=user[0]
+ self.adduser(udict, user[0], user[1], role)
return udict
def getHomeDirContext(self, user, home, role):
@@ -362,9 +217,8 @@
@@ -362,9 +216,8 @@
return ret + rc[1] + "\n"
def getUserContext(self, user, sel_user, role):
@ -337,7 +336,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon po
def genHomeDirContext(self):
users = self.getUsers()
@@ -478,10 +332,6 @@
@@ -478,10 +331,6 @@
if type==None:
type=getSELinuxType(directory)

View File

@ -3,7 +3,7 @@
Summary: SELinux policy core utilities.
Name: policycoreutils
Version: 1.27.27
Release: 2
Release: 3
License: GPL
Group: System Environment/Base
Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@ -88,7 +88,7 @@ rm -rf ${RPM_BUILD_ROOT}
%config(noreplace) %{_sysconfdir}/sestatus.conf
%changelog
* Fri Nov 11 2005 Dan Walsh <dwalsh@redhat.com> 1.27.27-2
* Fri Nov 11 2005 Dan Walsh <dwalsh@redhat.com> 1.27.27-3
- Patch genhomedircon to use libsemanage.py stuff
* Wed Nov 9 2005 Dan Walsh <dwalsh@redhat.com> 1.27.27-1