Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

lachlan-roberts
Copy link
Contributor

Fixes #10055

Use single quotes around property values containing $ for --dry-run.

@lachlan-roberts lachlan-roberts requested review from joakime and gregw July 3, 2023 03:21
@@ -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;
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

@gregw gregw left a 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.

Comment on lines +698 to +700
if (isDryRun() && value != null && value.contains("$"))
value = "'" + value + "'";
cmd.addArg(property.key + "=" + value);
Copy link
Contributor

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?

@gregw
Copy link
Contributor

gregw commented Jul 12, 2023

Replaced by #10090

@gregw gregw closed this Jul 12, 2023
@lachlan-roberts lachlan-roberts deleted the jetty-12.0.x-10055-core-deploy branch July 14, 2023 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants