2ff281da27
- Fix genhomedircon to work on MLS policy
70 lines
2.5 KiB
Diff
70 lines
2.5 KiB
Diff
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
|
|
+++ policycoreutils-1.29.9/scripts/chcat.8 2006-01-19 17:23:42.000000000 -0500
|
|
@@ -27,6 +27,11 @@
|
|
Change/Remove the security CATEGORY for each FILE/USER.
|
|
.PP
|
|
Use +/- to add/remove categories from a FILE/USER.
|
|
+.PP
|
|
+.B
|
|
+Note:
|
|
+When removing a category you must specify '--' on the command line before using the -Category syntax. This tells the shell that you have finished entering options.
|
|
+
|
|
.TP
|
|
\fB\-d\fR
|
|
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()
|