New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set `java.security.egd` system property #5132

Closed
bozakp opened this Issue Apr 7, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@bozakp

bozakp commented Apr 7, 2018

Environment

  • jruby 9.1.16.0 (2.3.3) 2018-02-21 8f3f95a Java HotSpot(TM) 64-Bit Server VM 25.161-b12 on 1.8.0_161-b12 +jit [darwin-x86_64]
  • Darwin Kernel Version 16.7.0: Tue Jan 30 11:27:06 PST 2018; root:xnu-3789.73.11~1/RELEASE_X86_64 x86_64

Expected Behavior

  • I expected to be able to set the java.security.egd java system property.

Actual Behavior

$ jruby -e "puts java.lang.System.getProperty('java.security.egd')"
file:/dev/urandom
$ jruby -J-Djava.security.egd=file:/dev/./urandom -e "puts java.lang.System.getProperty('java.security.egd')"
-Djava.security.egd=file:/dev/./urandom

Note that the value of the system property starts with -DJava.security.... Introduced in 1a4f888 (the fix for #4685), the value of JAVA_SECURITY_EGD is set to the whole argument, and not the value substring.

@enebo enebo added this to the JRuby 9.1.17.0 milestone Apr 11, 2018

@headius

This comment has been minimized.

Member

headius commented Apr 12, 2018

Oops!

@headius

This comment has been minimized.

Member

headius commented Apr 12, 2018

Ok, I've committed a fix for this to our jruby.bash script, which becomes the jruby and ruby commands in the JRuby tarball.

I also confirmed that the native jruby executable provided by the jruby-launcher gem does not appear to have this bug.

@headius

This comment has been minimized.

Member

headius commented Apr 12, 2018

I suppose we should have a test for this...probably in test_command_line_options? And perhaps another in https://github.com/jruby/jruby-launcher?

@headius headius added the tests label Apr 12, 2018

@headius headius closed this in fda229c Apr 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment