From 996ac469b3013e4bcda8bc2f3bcb49ef57740a1f Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Tue, 7 Oct 2008 22:46:02 -0400 Subject: Fix scenario when SELinux support tools exist, but SELinux is disabled --- lib/puppet/util/selinux.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/puppet') 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" -- cgit