Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
dracut
> 0138-selinux-fixed-error-handling-for-load-policy.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0138-selinux-fixed-error-handling-for-load-policy.patch of Package dracut
From f35ef174ca051cf165737e497ccaaaf7b98374dd Mon Sep 17 00:00:00 2001 From: Harald Hoyer <harald@redhat.com> Date: Wed, 21 Jul 2010 13:44:03 +0200 Subject: [PATCH] selinux: fixed error handling for load-policy {} | cmd opens a subshell for {} --- modules.d/99base/selinux-loadpolicy.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/modules.d/99base/selinux-loadpolicy.sh b/modules.d/99base/selinux-loadpolicy.sh index 7db9f8c..9959993 100755 --- a/modules.d/99base/selinux-loadpolicy.sh +++ b/modules.d/99base/selinux-loadpolicy.sh @@ -18,19 +18,20 @@ rd_load_policy() # Attempt to load SELinux Policy if [ -x "$NEWROOT/usr/sbin/load_policy" -o -x "$NEWROOT/sbin/load_policy" ]; then - ret=0 + local ret=0 + local out info "Loading SELinux 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 + # load_policy does mount /proc and /selinux in + # libselinux,selinux_init_load_policy() + if [ -x "$NEWROOT/sbin/load_policy" ]; then + out=$(chroot "$NEWROOT" /sbin/load_policy -i 2>&1) + ret=$? + info $out + else + out=$(chroot "$NEWROOT" /usr/sbin/load_policy -i 2>&1) + ret=$? + info $out + fi if [ "$SELINUX" = "disabled" ]; then return 0; -- 1.8.3.1