rpms/policycoreutils/devel policycoreutils-rhat.patch, 1.366, 1.367 policycoreutils.spec, 1.527, 1.528

Daniel J Walsh (dwalsh) fedora-extras-commits at redhat.com
Thu Jun 12 18:36:07 UTC 2008


Author: dwalsh

Update of /cvs/extras/rpms/policycoreutils/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv24087

Modified Files:
	policycoreutils-rhat.patch policycoreutils.spec 
Log Message:
* Thu Jun 12 2008 Dan Walsh <dwalsh at redhat.com> 2.0.49-6
- Add deleteall to semanage permissive, cleanup error handling


policycoreutils-rhat.patch:

Index: policycoreutils-rhat.patch
===================================================================
RCS file: /cvs/extras/rpms/policycoreutils/devel/policycoreutils-rhat.patch,v
retrieving revision 1.366
retrieving revision 1.367
diff -u -r1.366 -r1.367
--- policycoreutils-rhat.patch	11 Jun 2008 20:20:15 -0000	1.366
+++ policycoreutils-rhat.patch	12 Jun 2008 18:35:22 -0000	1.367
@@ -104,25 +104,113 @@
  .TP 
 diff --exclude-from=exclude --exclude=sepolgen-1.0.11 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage policycoreutils-2.0.49/semanage/semanage
 --- nsapolicycoreutils/semanage/semanage	2008-05-22 14:01:41.000000000 -0400
-+++ policycoreutils-2.0.49/semanage/semanage	2008-06-11 16:13:26.349017000 -0400
-@@ -52,6 +52,7 @@
- semanage fcontext -{a|d|m} [-frst] file_spec\n\
- semanage translation -{a|d|m} [-T] level\n\n\
- semanage boolean -{d|m} boolean\n\n\
-+semanage permissive -{d|a} type\n\n\
- \
- Primary Options:\n\
- \
-@@ -112,6 +113,8 @@
++++ policycoreutils-2.0.49/semanage/semanage	2008-06-12 14:34:26.499263000 -0400
+@@ -43,49 +43,52 @@
+ if __name__ == '__main__':
+ 
+ 	def usage(message = ""):
+-		print _('\
+-semanage {boolean|login|user|port|interface|fcontext|translation} -{l|D} [-n] \n\
+-semanage login -{a|d|m} [-sr] login_name\n\
+-semanage user -{a|d|m} [-LrRP] selinux_name\n\
+-semanage port -{a|d|m} [-tr] [ -p proto ] port | port_range\n\
+-semanage interface -{a|d|m} [-tr] interface_spec\n\
+-semanage fcontext -{a|d|m} [-frst] file_spec\n\
+-semanage translation -{a|d|m} [-T] level\n\n\
+-semanage boolean -{d|m} boolean\n\n\
+-\
+-Primary Options:\n\
+-\
+-	-a, --add        Add a OBJECT record NAME\n\
+-	-d, --delete     Delete a OBJECT record NAME\n\
+-	-m, --modify     Modify a OBJECT record NAME\n\
+-	-l, --list       List the OBJECTS\n\n\
+-	-C, --locallist  List OBJECTS local customizations\n\n\
+-	-D, --deleteall  Remove all OBJECTS local customizations\n\
+-\
+-	-h, --help       Display this message\n\
+-	-n, --noheading  Do not print heading when listing OBJECTS\n\
+-        -S, --store      Select and alternate SELinux store to manage\n\n\
+-Object-specific Options (see above):\n\
+-	-f, --ftype      File Type of OBJECT \n\
+-		"" (all files) \n\
+-		-- (regular file) \n\
+-		-d (directory) \n\
+-		-c (character device) \n\
+-		-b (block device) \n\
+-		-s (socket) \n\
+-		-l (symbolic link) \n\
+-		-p (named pipe) \n\n\
+-\
+-	-p, --proto      Port protocol (tcp or udp)\n\
+-	-P, --prefix     Prefix for home directory labeling\n\
+-	-L, --level      Default SELinux Level (MLS/MCS Systems only)\n\
+-	-R, --roles      SELinux Roles (ex: "sysadm_r staff_r")\n\
+-	-T, --trans      SELinux Level Translation (MLS/MCS Systems only)\n\n\
+-\
+-	-s, --seuser     SELinux User Name\n\
+-	-t, --type       SELinux Type for the object\n\
+-	-r, --range      MLS/MCS Security Range (MLS/MCS Systems only)\n\
+-')
++		print _("""
++semanage {boolean|login|user|port|interface|fcontext|translation} -{l|D} [-n] 
++semanage login -{a|d|m} [-sr] login_name
++semanage user -{a|d|m} [-LrRP] selinux_name
++semanage port -{a|d|m} [-tr] [ -p proto ] port | port_range
++semanage interface -{a|d|m} [-tr] interface_spec
++semanage fcontext -{a|d|m} [-frst] file_spec
++semanage translation -{a|d|m} [-T] level
++semanage boolean -{d|m} boolean
++semanage permissive -{d|a} type
++
++Primary Options:
++
++	-a, --add        Add a OBJECT record NAME
++	-d, --delete     Delete a OBJECT record NAME
++	-m, --modify     Modify a OBJECT record NAME
++	-l, --list       List the OBJECTS
++	-C, --locallist  List OBJECTS local customizations
++	-D, --deleteall  Remove all OBJECTS local customizations
++
++	-h, --help       Display this message
++	-n, --noheading  Do not print heading when listing OBJECTS
++        -S, --store      Select and alternate SELinux store to manage
++
++Object-specific Options (see above):
++
++	-f, --ftype      File Type of OBJECT 
++		"" (all files) 
++		-- (regular file) 
++		-d (directory) 
++		-c (character device) 
++		-b (block device) 
++		-s (socket) 
++		-l (symbolic link) 
++		-p (named pipe) 
++
++	-p, --proto      Port protocol (tcp or udp)
++	-P, --prefix     Prefix for home directory labeling
++	-L, --level      Default SELinux Level (MLS/MCS Systems only)
++	-R, --roles      SELinux Roles (ex: "sysadm_r staff_r")
++	-T, --trans      SELinux Level Translation (MLS/MCS Systems only)
++
++	-s, --seuser     SELinux User Name
++	-t, --type       SELinux Type for the object
++	-r, --range      MLS/MCS Security Range (MLS/MCS Systems only)
++""")
+ 		print message
+ 		sys.exit(1)
+ 		
+@@ -112,6 +115,8 @@
  		valid_option["translation"] += valid_everyone + [ '-T', '--trans' ] 
  		valid_option["boolean"] = []
  		valid_option["boolean"] += valid_everyone + [ '--on', "--off", "-1", "-0" ] 
 +		valid_option["permissive"] = []
-+		valid_option["permissive"] += [ '-a', '--add', '-d', '--delete', '-l', '--list', '-h', '--help', '-n', '--noheading', ]
++		valid_option["permissive"] += [ '-a', '--add', '-d', '--delete', '-l', '--list', '-h', '--help', '-n', '--noheading', '-D', '--deleteall' ]
  		return valid_option
  
  	#
-@@ -266,6 +269,9 @@
+@@ -266,6 +271,9 @@
  		if object == "translation":
  			OBJECT = seobject.setransRecords()
  		
@@ -132,7 +220,7 @@
  		if list:
  			OBJECT.list(heading, locallist)
  			sys.exit(0);
-@@ -302,6 +308,9 @@
+@@ -302,6 +310,9 @@
  
  			if object == "fcontext":
  				OBJECT.add(target, setype, ftype, serange, seuser)
@@ -144,7 +232,7 @@
  		if modify:
 diff --exclude-from=exclude --exclude=sepolgen-1.0.11 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/semanage.8 policycoreutils-2.0.49/semanage/semanage.8
 --- nsapolicycoreutils/semanage/semanage.8	2008-05-22 14:01:41.000000000 -0400
-+++ policycoreutils-2.0.49/semanage/semanage.8	2008-06-11 16:18:48.296894000 -0400
++++ policycoreutils-2.0.49/semanage/semanage.8	2008-06-11 16:18:48.000000000 -0400
 @@ -17,6 +17,8 @@
  .br
  .B semanage fcontext \-{a|d|m} [\-frst] file_spec
@@ -169,7 +257,7 @@
 -
 diff --exclude-from=exclude --exclude=sepolgen-1.0.11 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-2.0.49/semanage/seobject.py
 --- nsapolicycoreutils/semanage/seobject.py	2008-05-22 14:01:41.000000000 -0400
-+++ policycoreutils-2.0.49/semanage/seobject.py	2008-06-11 16:13:41.213393000 -0400
++++ policycoreutils-2.0.49/semanage/seobject.py	2008-06-12 14:34:36.038161000 -0400
 @@ -1,5 +1,5 @@
  #! /usr/bin/python -E
 -# Copyright (C) 2005, 2006, 2007 Red Hat 
@@ -187,7 +275,7 @@
  import gettext
  gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
  gettext.textdomain(PROGNAME)
-@@ -246,7 +248,61 @@
+@@ -246,7 +248,67 @@
  		os.close(fd)
  		os.rename(newfilename, self.filename)
                  os.system("/sbin/service mcstrans reload > /dev/null")
@@ -214,9 +302,7 @@
 +
 +	def add(self, type):
 +               name = "permissive_%s" % type
-+               dirname = "/var/run/sepermissive"
-+               if not os.path.exists(dirname):
-+                      os.mkdir(dirname)
++               dirname = "/var/lib/selinux"
 +               os.chdir(dirname)
 +               filename = "%s.te" % name
 +               modtxt = """
@@ -234,9 +320,11 @@
 +               mc = module.ModuleCompiler()
 +               mc.create_module_package(filename, 1)
 +               rc, out = commands.getstatusoutput("semodule -i permissive_%s.pp" % type);
-+               import glob
-+               for i in glob.glob("permissive_%s.*" % type):
-+                      os.remove(i)
++               for root, dirs, files in os.walk("top", topdown=False):
++                      for name in files:
++                             os.remove(os.path.join(root, name))
++                      for name in dirs:
++                             os.rmdir(os.path.join(root, name))
 +
 +               if rc != 0:
 +                      raise ValueError(out)			
@@ -245,12 +333,18 @@
 +	def delete(self, name):
 +               rc, out = commands.getstatusoutput("semodule -r permissive_%s" % name );
 +               if rc != 0:
-+                      raise(out);
++                      raise ValueError(out)			
++
++	def deleteall(self):
++               l = self.get_all()
++               if len(l) > 0:
++                      all = " permissive_".join(l)
++                      self.delete(all)
 +
  class semanageRecords:
  	def __init__(self, store):
  		self.sh = semanage_handle_create()
-@@ -464,7 +520,7 @@
+@@ -464,7 +526,7 @@
  	def __init__(self, store = ""):
  		semanageRecords.__init__(self, store)
  


Index: policycoreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/policycoreutils/devel/policycoreutils.spec,v
retrieving revision 1.527
retrieving revision 1.528
diff -u -r1.527 -r1.528
--- policycoreutils.spec	12 Jun 2008 16:08:44 -0000	1.527
+++ policycoreutils.spec	12 Jun 2008 18:35:22 -0000	1.528
@@ -6,7 +6,7 @@
 Summary: SELinux policy core utilities
 Name:	 policycoreutils
 Version: 2.0.49
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPLv2+
 Group:	 System Environment/Base
 Source:	 http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@@ -63,6 +63,7 @@
 %install
 rm -rf %{buildroot}
 mkdir -p %{buildroot}/etc/rc.d/init.d
+mkdir -p %{buildroot}/var/lib/selinux
 mkdir -p %{buildroot}%{_bindir}
 mkdir -p %{buildroot}%{_sbindir}
 mkdir -p %{buildroot}/sbin
@@ -172,6 +173,7 @@
 %dir %{_libdir}/python?.?/site-packages/sepolgen
 %{_libdir}/python?.?/site-packages/sepolgen/*
 %dir  /var/lib/sepolgen
+%dir  /var/lib/selinux
 /var/lib/sepolgen/perm_map
 
 %preun
@@ -192,6 +194,9 @@
 fi
 
 %changelog
+* Thu Jun 12 2008 Dan Walsh <dwalsh at redhat.com> 2.0.49-6
+- Add deleteall to semanage permissive, cleanup error handling
+
 * Thu Jun 12 2008 Dan Walsh <dwalsh at redhat.com> 2.0.49-5
 - Complete removal of rhpl requirement
 




More information about the fedora-extras-commits mailing list