Change in vdsm[master]: tool: persist selinux booleans on ovirt node.

mtayer at redhat.com mtayer at redhat.com
Mon Oct 27 18:12:10 UTC 2014


mooli tayer has uploaded a new change for review.

Change subject: tool: persist selinux booleans on ovirt node.
......................................................................

tool: persist selinux booleans on ovirt node.

Otherwise seboolean configuration is deleted on every restart.

Change-Id: Ib3e86a4ad1a204b9157df398affa88b61a9bdc32
Signed-off-by: Mooli Tayer <mtayer at redhat.com>
---
M lib/vdsm/tool/configurators/sebool.py
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/34518/1

diff --git a/lib/vdsm/tool/configurators/sebool.py b/lib/vdsm/tool/configurators/sebool.py
index 654d7c7..213ccea 100644
--- a/lib/vdsm/tool/configurators/sebool.py
+++ b/lib/vdsm/tool/configurators/sebool.py
@@ -17,12 +17,17 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+import os
+
 from .import \
     CONFIGURED, \
     ModuleConfigure, \
     NOT_CONFIGURED
 
 from ... import utils
+
+if utils.isOvirtNode():
+    from ovirt.node.utils.fs import Config as NodeCfg
 
 
 SEBOOL_ENABLED = "on"
@@ -63,6 +68,17 @@
             if not status and any(sebool_status[sebool_variable]):
                 sebool_obj.modify(sebool_variable, SEBOOL_DISABLED)
 
+            if utils.isOvirtNode():
+                for mnt in ['/sys/fs/selinux/', '/selinux/']:
+                    bool_path = os.path.join(
+                        mnt,
+                        'booleans',
+                        sebool_variable
+                    )
+
+                    if os.path.exists(bool_path):
+                        NodeCfg().persist(bool_path)
+
         sebool_obj.finish()
 
     def isconfigured(self):


-- 
To view, visit http://gerrit.ovirt.org/34518
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3e86a4ad1a204b9157df398affa88b61a9bdc32
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>


More information about the vdsm-patches mailing list