-
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
do not automatically quote system properties containing spaces #9999
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,7 +441,7 @@ public void start(StartArgs args) throws IOException, InterruptedException | |
{ | ||
CommandLineBuilder cmd = args.getMainArgs(args.getDryRunParts()); | ||
cmd.debug(); | ||
System.out.println(cmd.toQuotedString()); | ||
System.out.println(cmd); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be fixed, but I suspect in a grander scale than this PR currently has done. The quoting is here to compensate for (system property) arguments specified in Removing it breaks that kind of usage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joakime Sorry but I'm not follow the pronouns... what "it" needs to be removed? what "this" needs to be fixed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is bigger than Use Cases (A): --dry-run output use/consumption
Use Cases (B): Quoting of arguments by start.jar
Use Cases (C): How the arguments are consumed
The change that lachlan did in this PR ...
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Agreed. Rather than arbitrarily going through start.jar adding or removing quotes, we need to step back and be very rigorous in understanding what spaces we have and if they are quoted or unquoted.
Obviously this is a quoted valued, so that it can be cut and pasted on the command line and executed.
ditto
ditto
ditto
Interesting... are windows command line quoting conventions the same as unix?
This is also a quoted value. I.e. The output of --dry-run should be quoted as necessary in all circumstances so that it can be correctly interpreted by a shell.
I think this is the more interesting area and probably where our problems lie:
The command line is expanded by the shell, thus the arguments that we receive are unquoted.
Our ini files are line separated, so they do not need to be quoted just for separation and preservation of spaces. So is this an unquoted space? However, we do expand
As above.
Lines from mod files are copied directly to be lines in ini files, so whatever space ini files are in, then mod file lines are the same.
As above. So I do not think our issue is with the output of --dry-run, as that simply must be correctly quoted so that a shell understands the argument separators and values. Specifically for this particular issue:
|
||
} | ||
|
||
if (args.isStopCommand()) | ||
|
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 breaks
jetty.sh
usage.See #9309
I'll try to write a DistributionTest (in this branch) that uses
jetty.sh
(test would be limited to only executing on Linux env)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.
Hmm, this is tricky, as it's a forked Exec (to bash + jetty.sh) that execs a JVM.
Getting the pid to stop the running JVM isn't that straight forward. (nor does
jetty.sh stop
work on this forked/execed JVM)I'm not going to continue with this testcase, I'm abandoning this effort.
Here's the scenario, in the form of a jetty base, that would cause the issue in #9309