sid-srini opened a new pull request, #7908:
URL: https://github.com/apache/netbeans/pull/7908
**Issue**
When NetBeans is launched on *nix shell with arguments that contain special
characters like quotes, spaces, $ and backticks, then it may fail or not
receive the arguments correctly.
The launcher scripts are:
- java/java.lsp.server/script/bin/nbcode
- platform/o.n.bootstrap/launcher/unix/nbexec
The cause is due to incomplete escaping of the special characters before
quoting the argument.
Examples:
- `--jdkhome "$HOME/openjdk's jdkhome"`
- `--jdkhome '/home/user/tools/jdk "23"'`
- `--jdkhome /c/Program\ Files/Java/jdk`
- `--userdir "/mnt/user's macbook pro/Users/user/Library/Application
Support/NetBeans"`
-
`-Dnetbeans.extra.dirs="nb-dev\$old/extras/plugin1:nb-dev\$old/extras/plugin2:ext/My
Plugins/quo\"'d"`
Further, a discrepancy is created between the argument strings passed on a
Windows host (using the launcher exe/dll) and *nix hosts.
**Fix**
1. Ensure that all arguments are quoted before passing forward to the
executable launch.
- This is implemented similar to other open-source build tools.
- Example:
[ant](https://github.com/apache/ant/blob/master/src/script/ant#L63)
2. Ensure that the special characters ' " $ ` in the argument are escaped
according to the quoting being performed.
3. Consistently use `eval` with arguments single-quoted and parameter
substitution within it being double-quoted.
- This makes `nbexec` similar to the `nbcode` script
4. Updated the unit test for `nbexec`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists