[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1601-gf8c1b08

James Turnbull james at lovedthanlost.net
Fri Jan 15 09:07:26 UTC 2010


The following commit has been merged in the upstream branch:
commit dc8812c371810aa1d3c723d8b42b9773d1ded851
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Mon Nov 23 17:40:03 2009 -0800

    Fixing 2792 selinux tries to set properties on unsupported filesystes
    
    Check that a specific file supports selinux properties before trying to
    set them.
    This patch is functionally identical to the one Darrell Fuhriman
    submitted with the bug report.
    
    Signed-off-by: Jesse Wolfe <jes5199 at gmail.com>

diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb
index bdf4415..25d86f7 100644
--- a/lib/puppet/util/selinux.rb
+++ b/lib/puppet/util/selinux.rb
@@ -91,7 +91,7 @@ module Puppet::Util::SELinux
     # I believe that the OS should always provide at least a fall-through context
     # though on any well-running system.
     def set_selinux_context(file, value, component = false)
-        unless selinux_support?
+        unless selinux_support? && selinux_label_support?(file) 
             return nil
         end
 
diff --git a/spec/unit/util/selinux.rb b/spec/unit/util/selinux.rb
index da4686e..2a9a418 100755
--- a/spec/unit/util/selinux.rb
+++ b/spec/unit/util/selinux.rb
@@ -158,6 +158,12 @@ describe Puppet::Util::SELinux do
             set_selinux_context("/foo", "user_u:role_r:type_t:s0").should be_nil
         end
 
+        it "should return nil if selinux_label_support returns false" do
+            self.expects(:selinux_support?).returns true
+            self.expects(:selinux_label_support?).with("/foo").returns false
+            set_selinux_context("/foo", "user_u:role_r:type_t:s0").should be_nil
+        end
+
         it "should use lsetfilecon to set a context" do
             self.expects(:selinux_support?).returns true
             Selinux.expects(:lsetfilecon).with("/foo", "user_u:role_r:type_t:s0").returns 0

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list