[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

Sean E. Millichamp sean at bruenor.org
Fri Jan 23 14:21:29 UTC 2009


The following commit has been merged in the master branch:
commit f7516a75d93b2fe97adea1b4296541be71ae5d9b
Author: Sean E. Millichamp <sean at bruenor.org>
Date:   Wed Oct 22 14:24:06 2008 -0400

    Fix regression caused by switch to Puppet's execute() functions

diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb
index 0a4af3c..1487489 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
 
diff --git a/spec/unit/util/selinux.rb b/spec/unit/util/selinux.rb
index 515c3a2..7a56f91 100644
--- a/spec/unit/util/selinux.rb
+++ b/spec/unit/util/selinux.rb
@@ -117,7 +117,7 @@ describe Puppet::Util::SELinux do
 
         it "should use chcon to set a context" do
             self.expects(:selinux_support?).returns true
-            self.expects(:execute).with(["/usr/bin/chcon","-h","","user_u:role_r:type_t:s0","/foo"]).returns 0
+            self.expects(:execute).with(["/usr/bin/chcon","-h","user_u:role_r:type_t:s0","/foo"]).returns 0
             set_selinux_context("/foo", "user_u:role_r:type_t:s0").should be_true
         end
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list