RFC: Netx - Support VM arguments specified in the JNLP file

Deepak Bhole dbhole at redhat.com
Thu Jun 4 14:47:22 PDT 2009


* Omair Majid <omajid at redhat.com> [2009-06-04 10:37]:
> Deepak Bhole wrote:
>> * Omair Majid <omajid at redhat.com> [2009-06-03 13:41]:
>>
>> Looks good. Couple of things though:
>>
>> 1. getForksAlowed() is spelled incorrectly..
> Fixed.
>
>> 2. There is a lot of unnecessary wrapping/unwrapping going on with the
>> whole convert array to list, add to list, convert list to array and
>> iterate over array. Why not just change initialArgs to be a list, and
>> then just use that list everywhere and iterate over it when launching the
>> new vm?
> Does the new patch look ok?
>


Yep, looks good. Please go ahead and apply. One minor thing you may want
to consider btw... put a securitymanager AllPermissions() check inside
setInitialArguments(). Only trusted code would have all perms. The
reason for this is that initialArgs are used to launch another process,
and one could in theory perhaps mangle them. Again though, this is
totally optional because I honestly cannot come up with any way to
exploit it, given how the code is laid out. So I leave it upto you.

Thanks!
Deepak

> ChangeLog:
> 2009-06-04  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/Launcher.java
>     (launchExternal): Modify to take in arguments to pass to the JVM and
>     arguments to pass to the Java program. Try to use the local file to
>     launch this instance if possible.
>     (launchExternal): Modify to take in arguments to pass to the JVM and
>     arguments to pass to the Java program. 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/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 to Netx.
>     (getInitialArguments): New function. Return the arguments passed to
>     Netx.
>     * rt/net/sourceforge/jnlp/services/XBasicService.java
>     (showDocument): Fix call to launchExternal to match the new
>     semantics.
>
>
> Cheers,
> Omair





More information about the distro-pkg-dev mailing list