Skip to contentSkip to conversation

fixfiles -C: relabel all file contexts that have changed

PATCH Applied Marshall Miller 2 participants 2 messages Jan 24, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixfiles -C: relabel all file contexts that have changed

This fixes the situation where one path is a substring of another path, but not a prefix. For example, if /lib and /var/lib have both changed in the file_contexts file, then /var/lib would not be selected for relabel even though it should.

Marshall Miller

scripts/fixfiles +1 -1
Index: policycoreutils/scripts/fixfiles
===================================================================
@@ -84,7 +84,7 @@
 	    do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then \
                   echo "$pattern"; \
                   case "$pattern" in *"*") \
-	               echo "$pattern" | sed 's,\*$,,g' >> ${TEMPFILE};;  
+	               echo "$pattern" | sed -e 's,^,^,' -e 's,\*$,,g' >> ${TEMPFILE};;  
                   esac; \
                fi; \
             done | \
#1 lore raw
Quoted 1 line · Marshall Miller

This fixes the situation where one path is a substring of another path, but not a prefix. For example, if /lib and /var/lib have both changed in the file_contexts file, then /var/lib would not be selected for relabel even though it should.

Thanks, applied.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.