Skip to contentSkip to conversation

selinux: umount $NEWROOT/dev and its submounts

PATCH In review WANG Chao 2 participants 2 messages Jun 18, 2013 1 message not in the archive

lore
Share & tools
lore

WANG Chao

author
#0 lore raw

PATCH 1/1 selinux: umount $NEWROOT/dev and its submounts

$NEWROOT/dev and its submounts should be umounted after we use it. Otherwise it fails other scripts that umount /sysroot only.

---
 modules.d/98selinux/selinux-loadpolicy.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/98selinux/selinux-loadpolicy.sh +1 -0
index 5dddfc2..436ee6b 100755
@@ -48,6 +48,7 @@ rd_load_policy()
             [ -e "$NEWROOT"/.autorelabel ] && LANG=C /usr/sbin/setenforce 0
             mount --rbind /dev "$NEWROOT/dev"
             LANG=C chroot "$NEWROOT" /sbin/restorecon -R /dev
+            umount -R "$NEWROOT/dev"
             return 0
         fi
 
Signature · 1 line
1.8.2.1
#2 lore raw
In reply to a message not in the archive
Quoted 14 lines · WANG Chao

$NEWROOT/dev and its submounts should be umounted after we use it. Otherwise it fails other scripts that umount /sysroot only.

---
 modules.d/98selinux/selinux-loadpolicy.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/98selinux/selinux-loadpolicy.sh +0 -0
index 5dddfc2..436ee6b 100755

modules.d/98selinux/selinux-loadpolicy.sh rd_load_policy() · line 54

Quoted 7 lines
modules.d/98selinux/selinux-loadpolicy.sh +1 -0
@@ -48,6 +48,7 @@ rd_load_policy()
             [ -e "$NEWROOT"/.autorelabel ] && LANG=C /usr/sbin/setenforce 0
             mount --rbind /dev "$NEWROOT/dev"
             LANG=C chroot "$NEWROOT" /sbin/restorecon -R /dev
+            umount -R "$NEWROOT/dev"
             return 0
         fi
 

Thanks! Pushed.