-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #10055 - fix core deploy with --dry-run #10056
Conversation
Signed-off-by: Lachlan Roberts <[email protected]>
@@ -693,7 +693,12 @@ else if (properties.size() > 0) | |||
// TODO module path | |||
|
|||
for (Prop property : environment.getProperties()) | |||
cmd.addArg(property.key + "=" + property.value); | |||
{ | |||
String value = property.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this ever be a genuine environment variable that should appear unquoted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, as the environment should be the properties after expansion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the essence of the fix is good. But we need to be more rigorous about what characters we quote and also handle escaped quotes.
if (isDryRun() && value != null && value.contains("$")) | ||
value = "'" + value + "'"; | ||
cmd.addArg(property.key + "=" + value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit arbitrary. What if the value contains space? what if the value contains '
or "
? Isn't there a method already that checks if a string needs to be quoted and then quotes it correctly, perhaps escaping quote characters?
Replaced by #10090 |
Fixes #10055
Use single quotes around property values containing
$
for--dry-run
.