[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.1rc1-141-gcdb2b90

James Turnbull james at lovedthanlost.net
Mon Aug 16 12:47:32 UTC 2010


The following commit has been merged in the upstream branch:
commit 3d7168bef36b36b4d399eeefd7dccaec75fd8bc9
Author: Markus Roberts <Markus at reality.com>
Date:   Tue May 4 15:57:08 2010 -0700

    Fix for #3107 Changing users on AIX
    
    There are several issues with changing the real, effective, and saved group
    and user ids in different environments (which methods to call, in what order,
    etc).  While the code being replaced by this patch appeared to work for Linux,
    Solaris, and (with a special case test) Darwin; it was failing under AIX and
    may have had edge-case problems under the others.
    
    Ruby back to 1.8.1 has supported a higher level interface that deals with the
    problem and captures a broader range of OSes; it's a single call for group and
    one for user--the details of rid/eid/svid, etc ordering are handled internally.
    Switching to that simplifies our code and should improve/unify our support of
    various OSes.

diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index 503c02b..e06d6e6 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -285,29 +285,15 @@ module Util
             # Child process executes this
             Process.setsid
             begin
-                if arguments[:stdinfile]
-                    $stdin.reopen(arguments[:stdinfile])
-                else
-                    $stdin.reopen("/dev/null")
-                end
+                $stdin.reopen(arguments[:stdinfile] || "/dev/null")
                 $stdout.reopen(output_file)
                 $stderr.reopen(error_file)
 
                 3.upto(256){|fd| IO::new(fd).close rescue nil}
-                if arguments[:gid]
-                    Process.egid = arguments[:gid]
-                    Process.gid = arguments[:gid] unless @@os == "Darwin"
-                end
-                if arguments[:uid]
-                    Process.euid = arguments[:uid]
-                    Process.uid = arguments[:uid] unless @@os == "Darwin"
-                end
+                Process::GID.change_privilege arguments[:gid] if arguments[:gid]
+                Process::UID.change_privilege arguments[:uid] if arguments[:uid]
                 ENV['LANG'] = ENV['LC_ALL'] = ENV['LC_MESSAGES'] = ENV['LANGUAGE'] = 'C'
-                if command.is_a?(Array)
-                    Kernel.exec(*command)
-                else
-                    Kernel.exec(command)
-                end
+                Kernel.exec(*command)
             rescue => detail
                 puts detail.to_s
                 exit!(1)

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list