aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/rc.sysinit
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2009-08-20 14:32:02 -0400
committerBill Nottingham <notting@redhat.com>2009-08-20 14:32:02 -0400
commitbddb8498736b32c124d957748f6a735db65eb51e (patch)
treeeb36d2a23df98b77dc736dc7539e97b72b320f75 /rc.d/rc.sysinit
parentb3154e63a132b0edc77bf6d278dadc314b48aaff (diff)
downloadinitscripts-bddb8498736b32c124d957748f6a735db65eb51e.tar
initscripts-bddb8498736b32c124d957748f6a735db65eb51e.tar.gz
initscripts-bddb8498736b32c124d957748f6a735db65eb51e.tar.bz2
initscripts-bddb8498736b32c124d957748f6a735db65eb51e.tar.xz
initscripts-bddb8498736b32c124d957748f6a735db65eb51e.zip
/selinux is not configurable. Don't pretend it is (fixes #518164)
Diffstat (limited to 'rc.d/rc.sysinit')
-rwxr-xr-xrc.d/rc.sysinit19
1 files changed, 9 insertions, 10 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index fbd443c4..f20c7d45 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -32,11 +32,10 @@ PLYMOUTH=
[ -x /usr/bin/plymouth ] && PLYMOUTH=yes
# Check SELinux status
-selinuxfs="$(fstab_decode_str $(LC_ALL=C awk '/ selinuxfs / { print $2 }' /proc/mounts))"
SELINUX_STATE=
-if [ -n "$selinuxfs" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
- if [ -r "$selinuxfs/enforce" ] ; then
- SELINUX_STATE=$(cat "$selinuxfs/enforce")
+if [ -e "/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
+ if [ -r "/selinux/enforce" ] ; then
+ SELINUX_STATE=$(cat "/selinux/enforce")
else
# assume enforcing if you can't read it
SELINUX_STATE=1
@@ -51,7 +50,7 @@ disable_selinux() {
echo $"*** Warning -- SELinux is active"
echo $"*** Disabling security enforcement for system recovery."
echo $"*** Run 'setenforce 1' to reenable."
- echo "0" > "$selinuxfs/enforce"
+ echo "0" > "/selinux/enforce"
}
relabel_selinux() {
@@ -69,7 +68,7 @@ relabel_selinux() {
echo $"*** /etc/selinux/config indicates you want to manually fix labeling"
echo $"*** problems. Dropping you to a shell; the system will reboot"
echo $"*** when you leave the shell."
- echo "0" > $selinuxfs/enforce
+ echo "0" > /selinux/enforce
sulogin
echo $"Unmounting file systems"
@@ -84,14 +83,14 @@ relabel_selinux() {
echo $"*** Relabeling could take a very long time, depending on file"
echo $"*** system size and speed of hard drives."
- echo "0" > $selinuxfs/enforce
+ echo "0" > /selinux/enforce
/sbin/fixfiles -F restore > /dev/null 2>&1
rm -f /.autorelabel
if [ ! -z "$REBOOTFLAG" ]; then
echo $"Automatic reboot in progress."
reboot -f
fi
- echo $SELINUX_STATE > $selinuxfs/enforce
+ echo $SELINUX_STATE > /selinux/enforce
[ -n "$PLYMOUTH" ] && plymouth --show-splash
fi
}
@@ -400,9 +399,9 @@ elif [ -f /.autofsck ]; then
echo $"*** Warning -- the system did not shut down cleanly. "
echo $"*** Dropping you to a shell; the system will continue"
echo $"*** when you leave the shell."
- [ -n "$SELINUX_STATE" ] && echo "0" > $selinuxfs/enforce
+ [ -n "$SELINUX_STATE" ] && echo "0" > /selinux/enforce
sulogin
- [ -n "$SELINUX_STATE" ] && echo "1" > $selinuxfs/enforce
+ [ -n "$SELINUX_STATE" ] && echo "1" > /selinux/enforce
[ -n "$PLYMOUTH" ] && plymouth --show-splash
fi
fsckoptions="$AUTOFSCK_OPT $fsckoptions"