98selinux: use setenforce to force permissive mode
authorHarald Hoyer <harald@redhat.com>
Thu, 11 Aug 2011 09:29:50 +0000 (11:29 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 11 Aug 2011 12:27:25 +0000 (14:27 +0200)
modules.d/98selinux/module-setup.sh
modules.d/98selinux/selinux-loadpolicy.sh

index 316b552..78e8cf8 100755 (executable)
@@ -12,5 +12,6 @@ depends() {
 
 install() {
     inst_hook pre-pivot 50 "$moddir/selinux-loadpolicy.sh"
+    dracut_install setenforce
 }
 
index 9d4cac5..6eb1dbb 100755 (executable)
@@ -42,7 +42,7 @@ rd_load_policy()
 
         if [ $ret -eq 0 -o $ret -eq 2 ]; then
             # If machine requires a relabel, force to permissive mode
-            [ -e "$NEWROOT"/.autorelabel ] && ( echo 0 > "$NEWROOT"/selinux/enforce )
+            [ -e "$NEWROOT"/.autorelabel ] && LANG=C /usr/sbin/setenforce 0
             mount --bind /dev "$NEWROOT/dev"
             LANG=C chroot "$NEWROOT" /sbin/restorecon -R /dev
             return 0