summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/util')
-rw-r--r--lib/puppet/util/selinux.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb
index c25773344..e99ee30e2 100644
--- a/lib/puppet/util/selinux.rb
+++ b/lib/puppet/util/selinux.rb
@@ -34,6 +34,9 @@ module Puppet::Util::SELinux
# Note: For this command to work a full, non-relative, filesystem path
# should be given.
def get_selinux_default_context(file)
+ unless selinux_support?
+ return nil
+ end
unless FileTest.executable?("/usr/sbin/matchpathcon")
return nil
end
@@ -73,6 +76,9 @@ module Puppet::Util::SELinux
# only a single component or update the entire context. It is just a
# wrapper around the chcon command.
def set_selinux_context(file, value, component = false)
+ unless selinux_support?
+ return nil
+ end
case component
when :seluser
flag = "-u"