You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the solution to this was to have a null return raise whatever errno provides (in the case of these tests EINVAL). This seems like the most logical way to handle errors in crypt to me. MRI if it detects non-ascii salts it uses first two bytes of whatever the salt is and the or's them to make sure they fit into ascii space. Then they use that? I don't understand the reasoning behind this but I highly doubt anyone is depending on this behavior because it only works for crypt with DES which increasingly is not used by anyone. I would also be a little disturbed if I was using DES and provided a salt and then saw that the salt was not preserved in the generated crypt string.
on current jruby-1_7 branch
$ bin/jruby -Xnative.verbose=true -I"lib" --1.9 -I test/externals/ruby1.9 -I test/externals/ruby1.9/ruby -r ./test/ruby19_env.rb -r minitest/excludes "test/externals/ruby1.9/ruby/test_m17n_comb.rb"
Successfully loaded native POSIX impl.
Run options:
Running tests:
................E..............................
Finished tests in 8.964000s, 5.2432 tests/s, 8112.0036 assertions/s.
test_str_crypt(TestM17NComb):
Java::JavaLang::NullPointerException:
org.jruby.RubyString.crypt(RubyString.java:2660)
org.jruby.RubyString$INVOKER$i$1$0$crypt.call(RubyString$INVOKER$i$1$0$crypt.gen)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
test.externals.ruby1_dot_9.ruby.test_m17n_comb.block_82$RUBY$test_str_crypt(test/externals/ruby1.9/ruby/test_m17n_comb.rb:795)
test$externals$ruby1_dot_9$ruby$test_m17n_comb$block_82$RUBY$test_str_crypt.call(test$externals$ruby1_dot_9$ruby$test_m17n_comb$block_82$RUBY$test_str_crypt)
org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:135)
org.jruby.runtime.CompiledBlock19.yieldSpecific(CompiledBlock19.java:97)
org.jruby.runtime.Block.yieldSpecific(Block.java:120)
org.jruby.ast.YieldOneNode.interpret(YieldOneNode.java:35)
The text was updated successfully, but these errors were encountered: