[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH ovirt-node-image] use policycoreutils instead of looking into selinuxfs



Signed-off-by: Alan Pevec <apevec redhat com>
---
 ovirt-node-image.spec.in |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ovirt-node-image.spec.in b/ovirt-node-image.spec.in
index 40831db..8f4c258 100644
--- a/ovirt-node-image.spec.in
+++ b/ovirt-node-image.spec.in
@@ -59,10 +59,10 @@ mkdir -p %{ovirt_cache_dir}/node-image-tmp
 mkdir -p %{ovirt_cache_dir}/yum
 
 sudo su - -c "cd $(pwd) &&
-              enforcing=$(cat /selinux/enforce 2>/dev/null)
-              case x\$enforcing in
-                  x1) setenforce 0 ;;
-                  x0) ;;
+              enforcing=\$(getenforce)
+              case $enforcing in
+                  Enforcing) setenforce Permissive ;;
+                  Permissive) ;;
                    *) if ksflatten %{name}.ks 2>/dev/null \
                         | grep -q '^selinux --disabled$'; then
                         echo WARNING: SELinux disabled in kickstart
@@ -75,8 +75,8 @@ sudo su - -c "cd $(pwd) &&
               livecd-creator --skip-minimize -c %{name}.ks -f %{name} \
                --tmpdir='%{ovirt_cache_dir}/node-image-tmp' \
                --cache='%{ovirt_cache_dir}/yum'
-              if x\$enforcing = x1; then
-                setenforce 1 || exit 1
+              if [ $enforcing = Enforcing ]; then
+                setenforce Enforcing || exit 1
               fi"
 sudo su - -c "cd $(pwd) && ./ovirt-pxe %{name}.iso"
 sudo su - -c "cd $(pwd) && chown -R $USER ."
-- 
1.5.5.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]