diff options
| author | Luke Kanies <luke@madstop.com> | 2008-10-23 01:19:07 +0200 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-10-23 01:19:07 +0200 |
| commit | 23d42aca2260562b951507f8a0382823619c19d7 (patch) | |
| tree | 0319dbc38b37bbd3b6f8bc43f34b2cc6bb3939f2 /lib/puppet/util | |
| parent | b7d72360f66e36d897cfd4436236a3607a6de5b7 (diff) | |
| parent | 22024bce8f47ea37d57e57dd25d42b8a1996693c (diff) | |
| download | puppet-23d42aca2260562b951507f8a0382823619c19d7.tar.gz puppet-23d42aca2260562b951507f8a0382823619c19d7.tar.xz puppet-23d42aca2260562b951507f8a0382823619c19d7.zip | |
Merge branch '0.24.x' of git://github.com/jamtur01/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/util')
| -rw-r--r-- | lib/puppet/util/selinux.rb | 13 |
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 |
