ruby-changes:49281
From: normal <ko1@a...>
Date: Fri, 22 Dec 2017 10:07:48 +0900 (JST)
Subject: [ruby-changes:49281] normal:r61398 (trunk): webrick/httpservlet/cgi_runner.rb: remove unnecessary open
normal 2017-12-22 10:07:45 +0900 (Fri, 22 Dec 2017) New Revision: 61398 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61398 Log: webrick/httpservlet/cgi_runner.rb: remove unnecessary open IO#reopen already takes string path names as well as IO objects (but not "| command" strings) This makes further auditing for inadvertant code execution easier. There's no actual bugfix or behavior change here, as no external data is passed to cgi_runner.rb. * lib/webrick/httpservlet/cgi_runner.rb: remove Kernel#open call [Misc #14216] Modified files: trunk/lib/webrick/httpservlet/cgi_runner.rb Index: lib/webrick/httpservlet/cgi_runner.rb =================================================================== --- lib/webrick/httpservlet/cgi_runner.rb (revision 61397) +++ lib/webrick/httpservlet/cgi_runner.rb (revision 61398) @@ -23,11 +23,11 @@ STDIN.binmode https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpservlet/cgi_runner.rb#L23 len = sysread(STDIN, 8).to_i out = sysread(STDIN, len) -STDOUT.reopen(open(out, "w")) +STDOUT.reopen(out, "w") len = sysread(STDIN, 8).to_i err = sysread(STDIN, len) -STDERR.reopen(open(err, "w")) +STDERR.reopen(err, "w") len = sysread(STDIN, 8).to_i dump = sysread(STDIN, len) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/