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

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:54 UTC 2009


The following commit has been merged in the master branch:
commit c4412ec90c7ac4fecc49bbb632a0c4e84efb2ad4
Author: Nigel Kersten <nigelk at google.com>
Date:   Thu Dec 4 13:08:16 2008 -0800

    add some more sanity checks around stdin

diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index b07b2df..a5f3c5b 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -268,7 +268,10 @@ module Util
 
     # Execute the desired command, and return the status and output.
     # def execute(command, failonfail = true, uid = nil, gid = nil)
-    def execute(command, arguments = {:failonfail => true, :combine => true, :stdin => "/dev/null"})
+    # :combine sets whether or not to combine stdout/stderr in the output
+    # :stdinfile sets a file that can be used for stdin. Passing a string
+    # for stdin is not currently supported.
+    def execute(command, arguments = {:failonfail => true, :combine => true})
         if command.is_a?(Array)
             command = command.flatten.collect { |i| i.to_s }
             str = command.join(" ")
@@ -321,7 +324,11 @@ module Util
             # Child process executes this
             Process.setsid
             begin
-                $stdin.reopen(arguments[:stdin])
+                if arguments[:stdinfile]
+                    $stdin.reopen(arguments[:stdinfile])
+                else
+                    $stdin.reopen("/dev/null")
+                end
                 $stdout.reopen(output_file)
                 $stderr.reopen(error_file)
 
@@ -466,4 +473,3 @@ require 'puppet/util/execution'
 require 'puppet/util/logging'
 require 'puppet/util/package'
 require 'puppet/util/warnings'
-

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list