ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31601] New: - asterisk propagation in wrapper script
Date Fri, 08 Oct 2004 10:59:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31601>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31601

asterisk propagation in wrapper script

           Summary: asterisk propagation in wrapper script
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: AIX
            Status: UNCONFIRMED
          Severity: Normal
          Priority: Other
         Component: Wrapper scripts
        AssignedTo: dev@ant.apache.org
        ReportedBy: guenther.koegel@encorus.com


The ant start script on Unix does not handle arguments containing multiple
asterisks very well, e.g. 
ant target -Dcron-pattern="1 2 * * *"
will expand the asterisks inside the property. The cause is the "eval" command
in the last line of the start script which removes the protection of the
arguments one step too early. A solution would look like:

... ant start script ...
ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\"
-Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts
org.apache.tools.ant.launch.Launcher $ANT_ARGS -lib \"$CLASSPATH\" "
if $ant_exec_debug ; then
    echo $ant_exec_command $ant_exec_args
fi
eval $ant_exec_command "$ant_exec_args"
.... ant start script ...

What is the difference? The arguments are added late and protected again against
the final eval command. Verify with

ant help -Dasterisk="* * *"

(Important is the asterisk in the middle!)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message