Skip to contentSkip to conversation

/usr/local policy patch

PATCH Russell Coker 1 participant 1 message Jun 23, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

The attached trivial patch changes "/usr(/local)?/" to "/usr/(local/)?". The reason for this is that the string "/something/" works with the stem compression code in matchpathcon and in this example will only involve regex library calls for files that are under the /usr directory. A string that has any regex meta-characters before the second '/' will not work with the stem compression code and therefore such regular expressions will be applied against all files on disk. This has a performance impact on setfiles and restorecon, the impact for two regexes is small, but it all adds up.

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
types.fc renamed from types.fc.orig +2 -2
@@ -389,8 +389,8 @@
 /usr/local/src(/.*)?		system_u:object_r:src_t
 /usr/local/man(/.*)?		system_u:object_r:man_t
 /usr/local/.*\.so(\.[^/]*)*	--	system_u:object_r:shlib_t
-/usr(/local)?/lib/wine/.*\.so   --	system_u:object_r:texrel_shlib_t
-/usr(/local)?/lib/libfame-.*\.so.*    --	system_u:object_r:texrel_shlib_t
+/usr/(local/)?lib/wine/.*\.so   --	system_u:object_r:texrel_shlib_t
+/usr/(local/)?lib/libfame-.*\.so.*    --	system_u:object_r:texrel_shlib_t
 
 
 #