aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2007-04-16 23:12:10 +0000
committerBill Nottingham <notting@redhat.com>2007-04-16 23:12:10 +0000
commitef30f95eb94be2017bc10ba69c77b3bf7929ac8e (patch)
treeebb5d393bdc899698222601837ca1fa46eac3940
parented2137ce28f919fef226668612c7c72f0c891b12 (diff)
downloadinitscripts-ef30f95eb94be2017bc10ba69c77b3bf7929ac8e.tar
initscripts-ef30f95eb94be2017bc10ba69c77b3bf7929ac8e.tar.gz
initscripts-ef30f95eb94be2017bc10ba69c77b3bf7929ac8e.tar.bz2
initscripts-ef30f95eb94be2017bc10ba69c77b3bf7929ac8e.tar.xz
initscripts-ef30f95eb94be2017bc10ba69c77b3bf7929ac8e.zip
restorecon on mount points when relabeling (#220322)
-rwxr-xr-xrc.d/rc.sysinit7
1 files changed, 7 insertions, 0 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 8b42d2f1..8485c6e5 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -722,6 +722,13 @@ if [ -n "$SELINUX_STATE" ]; then
restorecon /etc/mtab /etc/ld.so.cache /etc/blkid/blkid.tab /etc/resolv.conf >/dev/null 2>&1
fi
+# If relabeling, relabel mount points.
+if [ -n "$SELINUX_STATE" -a "$READONLY" != "yes" ]; then
+ if [ -f /.autorelabel ] || strstr "$cmdline" autorelabel ; then
+ retstorecon $(awk '!/^#/ && $4 !~ /noauto/ { print $2 }' /etc/fstab) >/dev/null 2>&1
+ fi
+fi
+
# Clear mtab
(> /etc/mtab) &> /dev/null