RFC: Netx - Support VM arguments specified in the JNLP file
Omair Majid
omajid at redhat.com
Tue Jun 9 14:08:29 PDT 2009
Deepak Bhole wrote:
> You can fix this by adding a check for -jar like others, but rather than
> excluding specific items, it would be better to check for allowed
> items. java-vm-args accepts only certain args:
>
> http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html
>
> (scroll to resources element).
>
> This covers any future arguments that might get added to java that allow
> classpath specification.
>
Fixed checkVMArgs(). It now compares the arguments to the list of
supported arguments. Also switched from invoking java directly to
relying on the javaws launcher (and pasing the arguments through -J-Xms
format) to reset the classpath.
2009-06-09 Omair Majid <omajid at redhat.com>
* rt/net/sourceforge/jnlp/JNLPFile.java
(needsNewJVM): New function. Returns true if the JNLP file requires
creating a new JVM.
(getNewVMArgs): New function. Returns arguments to pass to the new
JVM.
* rt/net/sourceforge/jnlp/JREDesc.java
(getVMArgs): Fix javadoc to reflect that return value can be null.
* rt/net/sourceforge/jnlp/Launcher.java
(launchExternal): Modify to take in arguments to pass to the JVM and
arguments to pass to Netx. Try to use the local file to launch this
instance if possible.
(launchExternal): Delegate to new launchExternal.
(launchExternal): New method. Take in arguments to pass to the JVM
and arguments to pass to Netx. Launch Netx with the with the
appropriate arguments.
(launchApplication): If needed, launch a new JVM and pass along the
Netx arguments.
* rt/net/sourceforge/jnlp/Parser.java:
(getJRE): Call checkVMArgs to check 'java-vm-args' for security. If
that fails, assume 'java-vm-args' is null.
(checkVMArgs): New method. Check that the vmArgs variable contains
safe arguments only.
(getValidVMArguments): New method.
(getValidStartingVMArguments): New method.
* rt/net/sourceforge/jnlp/resources/Messages.properties:
Add BXnofork.
* rt/net/sourceforge/jnlp/runtime/Boot/java:
Add -Xnofork to helpMessage
(main): Check for '-Xnofork'. Set initial arguments.
* rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java:
Add forksAllowed to store whether creating a new JVM is allowed. Add
initialArguments to store the arguments to Netx.
(getForksAllowed): New function. Check if creating a new JVM is
allowed.
(setForksAllowed): New function. Set whether creating a JVM is
allowed.
(setInitialArguments): New function. Store the arguments passed to
Netx.
(getInitialArguments): New function. Return the arguments passed to
Netx.
Cheers,
Omair
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netx-jvm-args.patch
Type: text/x-patch
Size: 20173 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090609/c441e070/netx-jvm-args.patch
More information about the distro-pkg-dev
mailing list