Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 193350 - dev-java/java-config-2.0.33-r1: launcher does not escape special chars in arguments
Summary: dev-java/java-config-2.0.33-r1: launcher does not escape special chars in arg...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High normal
Assignee: Java team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2007-09-21 17:19 UTC by Heinrich Nirschl
Modified: 2008-01-30 07:10 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Nirschl 2007-09-21 17:19:19 UTC
The script /usr/share/java-config-2/launcher/launcher.bash has a problem with arguments containing special characters like / " $ `

This causes strange errors for example in groovy when it is used with the -e option:

$ groovy -e 'println "Hello"'
Caught: groovy.lang.MissingPropertyException: No such property: Hello for class: script_from_command_line
        at script_from_command_line.run(script_from_command_line:1)
        at script_from_command_line.main(script_from_command_line)

I fixed it by replacing the loop starting in line 60 with this

# Rebuild arg list so it doesn't get messed up
for arg in "${@}"; do
        arg=${arg//\\/\\\\}
        arg=${arg//\`/\\\`}
        arg=${arg//\"/\\\"}
        arg=${arg//\$/\\\$}
        gjl_cmd_arg="${gjl_cmd_arg} \"${arg}\""
done
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2008-01-20 16:37:34 UTC
(In reply to comment #1)
> See
> http://overlays.gentoo.org/proj/java/changeset?new=projects%2Fjava-config-2%405936&old=projects%2Fjava-config-2%405934
> for changes.
> 

You forgot java after the exec in the debug print
Comment 4 Alistair Bush (RETIRED) gentoo-dev 2008-01-30 07:10:03 UTC
Fixed in 2.1.4