rpms/policycoreutils/devel policycoreutils-rhat.patch, 1.151, 1.152 policycoreutils.spec, 1.220, 1.221

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Jan 19 14:45:29 UTC 2006


Author: dwalsh

Update of /cvs/dist/rpms/policycoreutils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv25083

Modified Files:
	policycoreutils-rhat.patch policycoreutils.spec 
Log Message:
* Thu Jan 19 2006 Dan Walsh <dwalsh at redhat.com> 1.29.8-4
- Fixes for "add"-"modify" error messages
- Fixes for chcat


policycoreutils-rhat.patch:
 scripts/chcat         |   24 ++++++---
 semanage/semanage     |   26 ++++++++--
 semanage/semanage.8   |    7 ++
 semanage/seobject.py  |  129 +++++++++++++++++++++++++++++++++++++++++++++-----
 setsebool/setsebool.c |    7 +-
 5 files changed, 166 insertions(+), 27 deletions(-)

Index: policycoreutils-rhat.patch
===================================================================
RCS file: /cvs/dist/rpms/policycoreutils/devel/policycoreutils-rhat.patch,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -r1.151 -r1.152
--- policycoreutils-rhat.patch	18 Jan 2006 22:06:19 -0000	1.151
+++ policycoreutils-rhat.patch	19 Jan 2006 14:45:25 -0000	1.152
@@ -1,7 +1,43 @@
 diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/chcat policycoreutils-1.29.8/scripts/chcat
 --- nsapolicycoreutils/scripts/chcat	2006-01-18 11:12:43.000000000 -0500
-+++ policycoreutils-1.29.8/scripts/chcat	2006-01-18 13:52:39.000000000 -0500
-@@ -281,6 +281,7 @@
++++ policycoreutils-1.29.8/scripts/chcat	2006-01-19 09:41:13.000000000 -0500
+@@ -25,11 +25,19 @@
+ import commands, sys, os, pwd, string, getopt, re, selinux
+ import seobject
+ 
++def verify_users(users):
++    for u in users:
++        try:
++            pwd.getpwnam(u)
++        except KeyError, e:
++            error( "User %s does not exist" % u)
++
+ def chcat_user_add(orig, newcat, users):
+     errors=0
+     logins = seobject.loginRecords()
+     seusers=logins.get_all()
+     add_ind=0
++    verify_users(users)
+     for u in users:
+         if u in seusers.keys():
+             user=seusers[u]
+@@ -98,6 +106,7 @@
+     logins = seobject.loginRecords()
+     seusers=logins.get_all()
+     add_ind=0
++    verify_users(users)
+     for u in users:
+         if u in seusers.keys():
+             user=seusers[u]
+@@ -174,6 +183,7 @@
+     logins = seobject.loginRecords()
+     seusers=logins.get_all()
+     add_ind=0
++    verify_users(users)
+     for u in users:
+         if u in seusers.keys():
+             user=seusers[u]
+@@ -281,6 +291,7 @@
  	print "Usage %s -d File ..." % sys.argv[0]
  	print "Usage %s -l -d user ..." % sys.argv[0]
  	print "Usage %s -L" % sys.argv[0]
@@ -9,11 +45,17 @@
          print "Use -- to end option list.  For example"
          print "chcat -- -CompanyConfidential /docs/businessplan.odt"
          print "chcat -l +CompanyConfidential juser"
-@@ -298,12 +299,8 @@
+@@ -297,13 +308,14 @@
+     fd.close()
      return 0
      
++
  def listusercats(users):
 -    seusers = seobject.loginRecords().get_all()
++    if len(users) == 0:
++        users.append(os.getlogin())
++
++    verify_users(users)
      for u in users:
 -        if u in seusers.keys():
 -            cats=seobject.translate(seusers[u][1])
@@ -23,19 +65,8 @@
          cats=cats.split("-")
          if len(cats) > 1 and cats[1] != "s0":
              print "%s: %s" % (u, cats[1])
-@@ -350,10 +347,17 @@
-     if delete_ind:
-         sys.exit(chcat_replace(["s0"], ["s0"], cmds, login_ind))
- 
-+    if login_ind:
-+        if len(cmds) >= 1:
-+            for u in cmds:
-+                try:
-+                    pwd.getpwnam(u)
-+                except KeyError, e:
-+                    error( "User %s does not exist" % u)
-+        else:
-+            cmds.append(os.getlogin())
+@@ -352,8 +364,6 @@
+ 
      if list_ind:
          if login_ind:
 -            if len(cmds) < 1:
@@ -177,7 +208,7 @@
  
 diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-1.29.8/semanage/seobject.py
 --- nsapolicycoreutils/semanage/seobject.py	2006-01-18 11:12:43.000000000 -0500
-+++ policycoreutils-1.29.8/semanage/seobject.py	2006-01-18 17:03:01.000000000 -0500
++++ policycoreutils-1.29.8/semanage/seobject.py	2006-01-19 09:43:38.000000000 -0500
 @@ -21,9 +21,18 @@
  #
  #  
@@ -281,20 +312,6 @@
  class semanageRecords:
  	def __init__(self):
  		self.sh = semanage_handle_create()
-@@ -421,11 +506,11 @@
- 
- 		rc = semanage_port_modify_local(self.sh, k, p)
- 		if rc < 0:
--			raise ValueError("Failed to add port %s/%s" % (proto, port))
-+			raise ValueError("Failed to modify port %s/%s" % (proto, port))
- 	
- 		rc = semanage_commit(self.sh)
- 		if rc < 0:
--			raise ValueError("Failed to add port %s/%s" % (proto, port))
-+			raise ValueError("Failed to modify port %s/%s" % (proto, port))
- 
- 	def modify(self, port, proto, serange, setype):
- 		if serange == "" and setype == "":
 @@ -458,7 +543,7 @@
  
  		rc = semanage_commit(self.sh)
@@ -313,11 +330,9 @@
 +			if type == "reserved_port_t":
 +				continue
 +			level = semanage_context_get_mls(con)
- 			proto=semanage_port_get_proto_str(u)
- 			low=semanage_port_get_low(u)
- 			high = semanage_port_get_high(u)
--			if (name, proto) not in dict.keys():
--				dict[(name,proto)]=[]
++			proto=semanage_port_get_proto_str(u)
++			low=semanage_port_get_low(u)
++			high = semanage_port_get_high(u)
 +			dict[(low, high)]=(type, proto, level)
 +		return dict
 +
@@ -334,9 +349,11 @@
 +			if type == "reserved_port_t":
 +				continue
 +			level = semanage_context_get_mls(con)
-+			proto=semanage_port_get_proto_str(u)
-+			low=semanage_port_get_low(u)
-+			high = semanage_port_get_high(u)
+ 			proto=semanage_port_get_proto_str(u)
+ 			low=semanage_port_get_low(u)
+ 			high = semanage_port_get_high(u)
+-			if (name, proto) not in dict.keys():
+-				dict[(name,proto)]=[]
 +			if (type, proto) not in dict.keys():
 +				dict[(type,proto)]=[]
  			if low == high:
@@ -356,6 +373,24 @@
  		keys=dict.keys()
  		keys.sort()
  		for i in keys:
+@@ -614,7 +721,7 @@
+ 		
+ 		rc = semanage_commit(self.sh)
+ 		if rc < 0:
+-			raise ValueError("Failed to add interface %s" % interface)
++			raise ValueError("Failed to modify interface %s" % interface)
+ 
+ 	def delete(self, interface):
+ 		(rc,k) = semanage_iface_key_create(self.sh, interface)
+@@ -779,7 +886,7 @@
+ 
+ 		rc = semanage_commit(self.sh)
+ 		if rc < 0:
+-			raise ValueError("Failed to add file context for %s" % target)
++			raise ValueError("Failed to modify file context for %s" % target)
+ 		
+ 	def delete(self, target, ftype):
+ 		(rc,k) = semanage_fcontext_key_create(self.sh, target, self.file_types[ftype])
 diff --exclude-from=exclude -N -u -r nsapolicycoreutils/setsebool/setsebool.c policycoreutils-1.29.8/setsebool/setsebool.c
 --- nsapolicycoreutils/setsebool/setsebool.c	2006-01-04 13:07:46.000000000 -0500
 +++ policycoreutils-1.29.8/setsebool/setsebool.c	2006-01-18 13:27:42.000000000 -0500


Index: policycoreutils.spec
===================================================================
RCS file: /cvs/dist/rpms/policycoreutils/devel/policycoreutils.spec,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -r1.220 -r1.221
--- policycoreutils.spec	18 Jan 2006 22:06:24 -0000	1.220
+++ policycoreutils.spec	19 Jan 2006 14:45:25 -0000	1.221
@@ -4,7 +4,7 @@
 Summary: SELinux policy core utilities.
 Name: policycoreutils
 Version: 1.29.8
-Release: 3
+Release: 4
 License: GPL
 Group: System Environment/Base
 Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@@ -97,6 +97,10 @@
 %{_libdir}/python2.4/site-packages/seobject.py*
 
 %changelog
+* Thu Jan 19 2006 Dan Walsh <dwalsh at redhat.com> 1.29.8-4
+- Fixes for "add"-"modify" error messages
+- Fixes for chcat
+
 * Wed Jan 18 2006 Dan Walsh <dwalsh at redhat.com> 1.29.8-3
 - Add management of translation file to semaange and seobject
 




More information about the fedora-cvs-commits mailing list