From f7516a75d93b2fe97adea1b4296541be71ae5d9b Mon Sep 17 00:00:00 2001 From: "Sean E. Millichamp" Date: Wed, 22 Oct 2008 14:24:06 -0400 Subject: Fix regression caused by switch to Puppet's execute() functions --- lib/puppet/util/selinux.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index 0a4af3ca1..148748950 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -6,8 +6,12 @@ # are available. At this time (2008-09-26) these bindings aren't bundled on # any SELinux-using distribution I know of. +require 'puppet/util' + module Puppet::Util::SELinux + include Puppet::Util + def selinux_support? FileTest.exists?("/selinux/enforce") end @@ -103,10 +107,15 @@ module Puppet::Util::SELinux when :selrange flag = "-l" else - flag = "" + flag = nil end - execute(["/usr/bin/chcon","-h",flag,value,file]) + if flag.nil? + cmd = ["/usr/bin/chcon","-h",value,file] + else + cmd = ["/usr/bin/chcon","-h",flag,value,file] + end + execute(cmd) return true end -- cgit