summaryrefslogtreecommitdiff
path: root/modules.d
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2009-09-09 17:06:21 +0200
committerHarald Hoyer <harald@redhat.com>2009-09-09 17:06:21 +0200
commit94eb3cf22255b17ab5bc79aaadb828ddb4ec94ac (patch)
tree98cf529ba18c8dae0993dea1cd1036919c0ee42f /modules.d
parentcb47caf786f68b2c2a239bb726cf84f38b9b50b4 (diff)
downloaddracut-94eb3cf22255b17ab5bc79aaadb828ddb4ec94ac.tar.gz
dracut-94eb3cf22255b17ab5bc79aaadb828ddb4ec94ac.tar.bz2
dracut-94eb3cf22255b17ab5bc79aaadb828ddb4ec94ac.zip
selinux-loadpolicy: do not mount /proc and /selinux
load_policy already does these things for us
Diffstat (limited to 'modules.d')
-rwxr-xr-xmodules.d/99base/selinux-loadpolicy.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/modules.d/99base/selinux-loadpolicy.sh b/modules.d/99base/selinux-loadpolicy.sh
index 84b36577..eaaf3373 100755
--- a/modules.d/99base/selinux-loadpolicy.sh
+++ b/modules.d/99base/selinux-loadpolicy.sh
@@ -4,19 +4,20 @@
if [ -x "$NEWROOT/usr/sbin/load_policy" -o -x "$NEWROOT/sbin/load_policy" ] && [ -e "$NEWROOT/etc/sysconfig/selinux" ]; then
info "Loading SELinux policy"
{
- # load_policy does mount /proc and /selinux in libselinux,selinux_init_load_policy()
+ # load_policy does mount /proc and /selinux in libselinux,selinux_init_load_policy()
+ if [ -x "$NEWROOT/sbin/load_policy" ]; then
+ chroot "$NEWROOT" /sbin/load_policy -i
+ ret=$?
+ else
+ chroot "$NEWROOT" /usr/sbin/load_policy -i
+ ret=$?
+ fi
+ } 2>&1 | vinfo
- if [ -x "$NEWROOT/sbin/load_policy" ]; then
- chroot "$NEWROOT" /sbin/load_policy -i 2>&1
- else
- chroot "$NEWROOT" /usr/sbin/load_policy -i 2>&1
- fi
-
- if [ $? -eq 3 ]; then
+ if [ $ret -eq 3 ]; then
warn "Initial SELinux policy load failed and enforcing mode requested."
warn "Not continuing"
sleep 100d
exit 1
fi
- } | vinfo
fi