brooklyncentral / brooklyn

This project has moved and is now part of the ASF
https://github.com/apache/incubator-brooklyn
72 stars 27 forks source link

Ampersand is allowed unescaped in a double-quoted bash string #1451

Closed grkvlt closed 10 years ago

grkvlt commented 10 years ago
% export a="a&b"
% echo $a
a&b
% echo "a&b"
a&b
buildhive commented 10 years ago

Brooklyn Central » brooklyn #2419 FAILURE Looks like there's a problem with this pull request (what's this?)

ahgittin commented 10 years ago

looks right to me, and in fact

% echo "a \& b"
a \& b

so backslash-escaping it is wrong. however i'd like to see some testing of this.

plus the test StringEscapesTest.testBashEscapableAmpersand needs updating!

buildhive commented 10 years ago

Brooklyn Central » brooklyn #2420 SUCCESS This pull request looks good (what's this?)

grkvlt commented 10 years ago

Hah. it all falls apart when starting Tomcat, which does an eval on the Java command including $JAVA_OPTS so I'm trying to fix that by double quoting each definition...

buildhive commented 10 years ago

Brooklyn Central » brooklyn #2421 FAILURE Looks like there's a problem with this pull request (what's this?)

grkvlt commented 10 years ago

Need to fix JavaOptsTest now

grkvlt commented 10 years ago

Only quote individual JAVA_OPTS entries for TomcatServer because the catalina.sh startup script uses eval to run Java

buildhive commented 10 years ago

Brooklyn Central » brooklyn #2422 SUCCESS This pull request looks good (what's this?)

ahgittin commented 10 years ago

good fixes. merge when you're happy with it.

grkvlt commented 10 years ago

Merged, thanks @ahgittin :frog: