aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-08-30 15:17:14 -0400
committerBill Nottingham <notting@redhat.com>2011-08-30 15:17:14 -0400
commit8e35de888bde8b123bf19c23cb4e8974cb75475e (patch)
treec3a7017cffa43162029b960ca8a04dd611387319
parent588b435f07ef70684d7979b0472b8a0aabe44d71 (diff)
downloadinitscripts-8e35de888bde8b123bf19c23cb4e8974cb75475e.tar
initscripts-8e35de888bde8b123bf19c23cb4e8974cb75475e.tar.gz
initscripts-8e35de888bde8b123bf19c23cb4e8974cb75475e.tar.bz2
initscripts-8e35de888bde8b123bf19c23cb4e8974cb75475e.tar.xz
initscripts-8e35de888bde8b123bf19c23cb4e8974cb75475e.zip
selinuxfs moved, adjust code. (#733759)
-rw-r--r--Makefile1
-rwxr-xr-xrc.d/rc.sysinit14
-rwxr-xr-xsystemd/fedora-autorelabel2
-rwxr-xr-xsystemd/fedora-readonly6
4 files changed, 12 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 975317b9..3bbc48e1 100644
--- a/Makefile
+++ b/Makefile
@@ -163,6 +163,7 @@ clean:
make clean -C src
make clean -C po
@rm -fv *~ changenew ChangeLog.old *gz
+ @find . -name "*~" -exec rm -f {} \;
tag:
@git tag -a -f -m "Tag as $(TAG)" $(TAG)
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index fd907f4a..5248cfb1 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -36,9 +36,9 @@ PLYMOUTH=
# Check SELinux status
SELINUX_STATE=
-if [ -e "/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
- if [ -r "/selinux/enforce" ] ; then
- SELINUX_STATE=$(cat "/selinux/enforce")
+if [ -e "/sys/fs/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
+ if [ -r "/sys/fs/selinux/enforce" ] ; then
+ SELINUX_STATE=$(cat "/sys/fs/selinux/enforce")
else
# assume enforcing if you can't read it
SELINUX_STATE=1
@@ -53,7 +53,7 @@ disable_selinux() {
echo $"*** Warning -- SELinux is active"
echo $"*** Disabling security enforcement for system recovery."
echo $"*** Run 'setenforce 1' to reenable."
- echo "0" > "/selinux/enforce"
+ echo "0" > "/sys/fs/selinux/enforce"
}
relabel_selinux() {
@@ -61,7 +61,7 @@ relabel_selinux() {
# wrong context, so a reboot will be required after relabel
AUTORELABEL=
. /etc/selinux/config
- echo "0" > /selinux/enforce
+ echo "0" > /sys/fs/selinux/enforce
[ -n "$PLYMOUTH" ] && plymouth --hide-splash
if [ "$AUTORELABEL" = "0" ]; then
@@ -231,9 +231,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" > /selinux/enforce
+ [ -n "$SELINUX_STATE" ] && echo "0" > /sys/fs/selinux/enforce
sulogin
- [ -n "$SELINUX_STATE" ] && echo "1" > /selinux/enforce
+ [ -n "$SELINUX_STATE" ] && echo "1" > /sys/fs/selinux/enforce
[ -n "$PLYMOUTH" ] && plymouth --show-splash
fi
fsckoptions="$AUTOFSCK_OPT $fsckoptions"
diff --git a/systemd/fedora-autorelabel b/systemd/fedora-autorelabel
index 70ece423..61dc5517 100755
--- a/systemd/fedora-autorelabel
+++ b/systemd/fedora-autorelabel
@@ -10,7 +10,7 @@ relabel_selinux() {
# wrong context, so a reboot will be required after relabel
AUTORELABEL=
. /etc/selinux/config
- echo "0" > /selinux/enforce
+ echo "0" > /sys/fs/selinux/enforce
[ -x /bin/plymouth ] && plymouth --hide-splash
if [ "$AUTORELABEL" = "0" ]; then
diff --git a/systemd/fedora-readonly b/systemd/fedora-readonly
index 70e57a62..4e8003a2 100755
--- a/systemd/fedora-readonly
+++ b/systemd/fedora-readonly
@@ -7,9 +7,9 @@
# Check SELinux status
SELINUX_STATE=
-if [ -e "/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
- if [ -r "/selinux/enforce" ] ; then
- SELINUX_STATE=$(cat "/selinux/enforce")
+if [ -e "/sys/fs/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
+ if [ -r "/sys/fs/selinux/enforce" ] ; then
+ SELINUX_STATE=$(cat "/sys/fs/selinux/enforce")
else
# assume enforcing if you can't read it
SELINUX_STATE=1