Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
In IO#popen, to bypass the shell for avoiding messy shell escaping and potential security hole, giving command-line as an array containing string objects is available since Ruby 1.9. However, on JRuby, when passing arguments with shell special characters to IO#popen, whole arguments seem to be omitted.
$ jruby -v -e 'p IO.popen(["/bin/echo", "(a)", "*" ], "r+") { |io| io.read }'
jruby 1.7.0.preview1 (ruby-1.9.3-p203) (2012-05-19 00c8c98) (OpenJDK 64-Bit Server VM 1.6.0_20) [linux-amd64-java]
"\n"
In MRI, the /bin/echo works correctly.
$ ruby -v -e 'p IO.popen(["/bin/echo", "(a)", "*" ], "r+") { |io| io.read }'
ruby 1.9.3p253 (2012-07-04) [x86_64-linux]
"(a) *\n"
Still broken on master, and probably won't be fixed for 1.7pre2.