rpms/policycoreutils/devel policycoreutils-rhat.patch, 1.317, 1.318 policycoreutils.spec, 1.432, 1.433

Daniel J Walsh (dwalsh) fedora-extras-commits at redhat.com
Wed Aug 1 20:08:31 UTC 2007


Author: dwalsh

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

Modified Files:
	policycoreutils-rhat.patch policycoreutils.spec 
Log Message:
* Wed Aug 1 2007 Dan Walsh <dwalsh at redhat.com> 2.0.22-13
- Speed up genhomedircon by an order of magnitude by compiling regex
- Allow semanage fcontext -a -t <<none>> /path to work


policycoreutils-rhat.patch:

Index: policycoreutils-rhat.patch
===================================================================
RCS file: /cvs/extras/rpms/policycoreutils/devel/policycoreutils-rhat.patch,v
retrieving revision 1.317
retrieving revision 1.318
diff -u -r1.317 -r1.318
--- policycoreutils-rhat.patch	1 Aug 2007 18:58:45 -0000	1.317
+++ policycoreutils-rhat.patch	1 Aug 2007 20:07:58 -0000	1.318
@@ -18,6 +18,17 @@
  	-mkdir -p $(MANDIR)/man1
  	install -m 644 audit2allow.1 $(MANDIR)/man1/
  
+diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/ChangeLog policycoreutils-2.0.22/ChangeLog
+--- nsapolicycoreutils/ChangeLog	2007-07-16 14:20:43.000000000 -0400
++++ policycoreutils-2.0.22/ChangeLog	2007-06-21 05:17:13.000000000 -0400
+@@ -91,7 +91,6 @@
+ 1.33.15 2007-01-17
+ 	* Merged unicode-to-string fix for seobject audit from Dan Walsh.
+ 	* Merged man page updates to make "apropos selinux" work from Dan Walsh.
+-
+ 1.33.14 2007-01-16
+ 	* Merged newrole man page patch from Michael Thompson.
+ 
 diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/Makefile policycoreutils-2.0.22/Makefile
 --- nsapolicycoreutils/Makefile	2007-07-16 14:20:43.000000000 -0400
 +++ policycoreutils-2.0.22/Makefile	2007-07-31 15:45:57.000000000 -0400
@@ -125,13 +136,50 @@
  # 
 diff --exclude-from=exclude --exclude=sepolgen-1.0.8 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-2.0.22/scripts/genhomedircon
 --- nsapolicycoreutils/scripts/genhomedircon	2007-07-16 14:20:41.000000000 -0400
-+++ policycoreutils-2.0.22/scripts/genhomedircon	2007-07-31 15:45:57.000000000 -0400
-@@ -302,7 +302,7 @@
- 			    
- 			    regex = re.sub("\(\/\.\*\)\?", "", regex)
- 			    regex = regex + "/*$"
++++ policycoreutils-2.0.22/scripts/genhomedircon	2007-08-01 16:03:41.000000000 -0400
+@@ -139,7 +139,22 @@
+ 		self.default_user = "user_u"
+ 		self.default_prefix = "user"
+ 		self.users = self.getUsers()
++		fd = open(self.getFileContextFile())
++		self.fclines=[]
++		for i in fd.readlines():
++		    try:
++			    regex = i.split()[0]
++			    #match a trailing .+
++			    regex = re.sub("\.+$", "", regex)
++			    regex = re.sub("\.\*$", "", regex)
++			    regex = re.sub("\(\/\.\*\)\?", "", regex)
++			    regex = regex + "/*$"
++			    self.fclines.append(re.compile(regex))
++		    except:
++			    continue
+ 
++		fd.close()
++		
+ 	def getFileContextDir(self):
+ 		return self.selinuxdir+self.type+self.filecontextdir
+ 
+@@ -289,20 +304,9 @@
+ 		return ret+"\n"
+ 
+ 	def checkExists(self, home):
+-		fd = open(self.getFileContextFile())
+-		for i in  fd.readlines():
+-                    if len(i) == 0:
+-			    continue
++		for i in self.fclines:
+ 		    try:
+-			    regex = i.split()[0]
+-			    #match a trailing .+
+-			    regex = re.sub("\.+$", "", regex)
+-			    regex = re.sub("\.\*$", "", regex)
+-			    #strip a (/.*)? which matches anything trailing to a /*$ which matches trailing /'s
+-			    
+-			    regex = re.sub("\(\/\.\*\)\?", "", regex)
+-			    regex = regex + "/*$"
 -			    if re.search(regex,home, 0):
-+			    if re.match(regex,home):
++			    if i.match(home):
  				    return 1
  		    except:
  			    continue


Index: policycoreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/policycoreutils/devel/policycoreutils.spec,v
retrieving revision 1.432
retrieving revision 1.433
diff -u -r1.432 -r1.433
--- policycoreutils.spec	1 Aug 2007 13:42:41 -0000	1.432
+++ policycoreutils.spec	1 Aug 2007 20:07:58 -0000	1.433
@@ -6,7 +6,7 @@
 Summary: SELinux policy core utilities
 Name: policycoreutils
 Version: 2.0.22
-Release: 12%{?dist}
+Release: 13%{?dist}
 License: GPL
 Group: System Environment/Base
 Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz
@@ -192,10 +192,10 @@
 fi
 
 %changelog
-* Wed Aug 1 2007 Dan Walsh <dwalsh at redhat.com> 2.0.22-12
+* Wed Aug 1 2007 Dan Walsh <dwalsh at redhat.com> 2.0.22-13
+- Speed up genhomedircon by an order of magnitude by compiling regex
 - Allow semanage fcontext -a -t <<none>> /path to work
 
-
 * Fri Jul 27 2007 Dan Walsh <dwalsh at redhat.com> 2.0.22-11
 - Fixfiles update required to match new regex
 




More information about the fedora-extras-commits mailing list