summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2010-08-03 12:57:24 -0500
committerClark Williams <williams@redhat.com>2010-08-03 16:08:46 -0500
commitc4533579e85c77ebe476e1e301ef676498837997 (patch)
tree626f0e26a2dcd956177473a17ed839aa3b30a443
parent99b173a54cfe1c79d3be5928d0d111a557e340b7 (diff)
downloadmock-c4533579e85c77ebe476e1e301ef676498837997.tar.gz
mock-c4533579e85c77ebe476e1e301ef676498837997.tar.xz
mock-c4533579e85c77ebe476e1e301ef676498837997.zip
set state correctly for SELinux (BZ# 620143)
The new selinux plugin fakes SELinux being turned *off* in the chroot by bind-mounting a fake /proc/filesystems in the chroot. If this plugin is enabled, we should *not* do any SELinux attribute operations in the chroot. Setup this state correctly at init time. Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r--py/mock/backend.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/py/mock/backend.py b/py/mock/backend.py
index 7aac040..eb97219 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -101,8 +101,14 @@ class Root(object):
self.state("init plugins")
self._initPlugins()
- # figure out if SELinux is enabled on the host
- self.selinux = mock.util.selinuxEnabled()
+ # default to not doing selinux things
+ self.selinux = False
+
+ # if the selinux plugin is disabled and we have SELinux enabled
+ # on the host, we need to do SELinux things, so set the selinux
+ # state variable to true
+ if self.pluginConf['selinux_enable'] == False and mock.util.selinuxEnabled():
+ self.selinux = True
# officially set state so it is logged
self.state("start")