summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util
diff options
context:
space:
mode:
authorSean E. Millichamp <sean@bruenor.org>2008-10-22 14:24:06 -0400
committerSean E. Millichamp <sean@bruenor.org>2008-10-22 14:24:06 -0400
commitf7516a75d93b2fe97adea1b4296541be71ae5d9b (patch)
tree4746b11041b94b33933fc243a7d15979a9f9e94e /lib/puppet/util
parentc09d0cc128aa3f6a0b741422ae45326b258bae7d (diff)
downloadpuppet-f7516a75d93b2fe97adea1b4296541be71ae5d9b.tar.gz
puppet-f7516a75d93b2fe97adea1b4296541be71ae5d9b.tar.xz
puppet-f7516a75d93b2fe97adea1b4296541be71ae5d9b.zip
Fix regression caused by switch to Puppet's execute() functions
Diffstat (limited to 'lib/puppet/util')
-rw-r--r--lib/puppet/util/selinux.rb13
1 files changed, 11 insertions, 2 deletions
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