Signed-off-by: Nigel Kersten <[email protected]>
---
 lib/puppet/util/suidmanager.rb |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/util/suidmanager.rb b/lib/puppet/util/suidmanager.rb
index a0a9178..99ed3a4 100644
--- a/lib/puppet/util/suidmanager.rb
+++ b/lib/puppet/util/suidmanager.rb
@@ -9,12 +9,25 @@ module Puppet::Util::SUIDManager
     to_delegate_to_process = [ :euid=, :euid, :egid=, :egid,
                                :uid=, :uid, :gid=, :gid, :groups=, :groups ]
 
+    if Facter.value('kernel') == 'Darwin'
+        Facter.loadfacts
+        osx_maj_ver = Facter.value('macosx_productversion_major')
+        raise Puppet::Error, "OS X requires Facter >= 1.5.5" if 
osx_maj_ver.nil?
+        # Process.groups= broken on 10.6 http://openradar.appspot.com/7791698
+        if osx_maj_ver == '10.6'
+            to_delegate_to_process.delete(:groups=)
+            def self.groups=(grouplist)
+                return true
+            end
+        end
+    end
+
     to_delegate_to_process.each do |method|
         def_delegator Process, method
         module_function method
     end
 
-    if Facter['kernel'].value == 'Darwin'
+    if Facter.value('kernel') == 'Darwin' and osx_maj_ver == '10.4'
         # Cannot change real UID on Darwin so we set euid
         alias :uid :euid
         alias :gid :egid
-- 
1.7.0.3

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to