Skip to contentSkip to conversation

semanage patch

PATCH Russell Coker 1 participant 1 message Jan 14, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

The attached patch fixes a bug in a check for user existence that prevented adding a new user, allows specifying the default level for users via the -L option, and fixes a mis-spelling of "delete" in code.

Also attached a re-written man page that uses better formatting and more precision in the SYNOPSIS section. The changes were significant enough that diff wouldn't do anything useful.

Signature · 4 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page
seobject.py renamed from seobject.py.orig +1 -1
@@ -134,7 +134,7 @@
 			raise ValueError("Could not create a key for %s" % name)
 
 		(rc,exists) = semanage_user_exists(self.sh, k)
-		if not exists:
+		if exists:
 			raise ValueError("SELinux user %s is already defined." % name)
 
 		(rc,u) = semanage_user_create(self.sh)
semanage renamed from semanage.orig +6 -2
@@ -84,7 +84,7 @@
 			
 		args = sys.argv[2:]
 		gopts, cmds = getopt.getopt(args,
-					    'adf:lhmnp:P:s:R:r:t:v',
+					    'adf:lhmnp:P:s:R:L:r:t:v',
 					    ['add',
 					     'delete',
 					     'ftype=',
@@ -96,6 +96,7 @@
 					     'proto=',
 					     'seuser=',
 					     'range=',
+					     'level=',
 					     'roles=',
 					     'type=',
 					     'verbose'
@@ -106,7 +107,7 @@
 					usage()
 				add = 1
 				
-			if o == "-d"  or o == "--delese":
+			if o == "-d"  or o == "--delete":
 				if modify or add:
 					usage()
 				delete = 1
@@ -126,6 +127,9 @@
 			if o == "-r" or o == '--range':
 				serange = a
 
+			if o == "-L" or o == '--level':
+				selevel = a
+
 			if o == "-P" or o == '--proto':
 				proto = a