-
Notifications
You must be signed in to change notification settings - Fork 928
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
Options are not passed correctly to programs #201
Options are not passed correctly to programs #201
Conversation
I confirm the problem with leading - values, which is easy to reproduce as above. I was trying to pass Java system properties via a -Dkey=val and got the "true" value. If you pass in this string with a leading space it does get through, and is enclosed in single quotes when substituted. |
I think I understand the problem now, you are saying that if an option value is something like "-value", the value will not be used correctly when passed to the underlying script execution. My guess is the options parser is incorrectly treating "-optionname -value" as if it were two separate boolean flag options. However, rundeck doesn't (any longer) allow that kind of option, so it must have some lingering improper treatment of the options string. |
…nCentral Merge branch 'issues/276-illegal-gradle-dependencies' of git.soma.salesforce.com:gigantor/rundeck into issues/276-illegal-gradle-dependencies
This is the (very) beginning of a fix to rundeck#298. Unfortunately, doing this in a way that doesn't compromise backwards compatibility is out-of-scope, and will probably call for a multi-phase implementation -- for instance, adding a per-job flag to specify compatible or safe quoting, providing warnings and (eventually) deprecation notices to users with jobs using unsafe quoting, and (again, eventually) flipping the default.
Shell quoting does not apply to entire argv elements, but only individual characters thereof -- and different characters within a string can be quoted in different ways. As such, a promise to treat "pre-quoted" argv elements differently is not sensible; moreover, this promise restricts the set of data which can be legitimately passed (whereas natively, argv array entries can contain any non-NUL bytes -- including, of course, embedded literal quotes). The new, safe algorithm does not respect the traditional implementation's promise to preserve original quoting. Clarify this in the docstring.
…esforce.com:gigantor/rundeck into issues/276-illegal-gradle-dependencies
…gradle-dependencies Changes to repos / dependency management Conflicts: rundeckapp/build.gradle
Add alternate, safe quoting to CLIUtils (optional, off-by-default)
…e-dependencies Remove gradle runtime dependencies hack. Conflicts: core/pom.xml
Docs are built separately as a zip war no longer includes docs within it
…ation-plugins Add notification plugins fixes rundeck#360
…order Static option order support closes rundeck#361
…rsing Fix job xml datatype parsing fixes rundeck#353 and fixes rundeck#356
Remove old boolean value support for "-flag", and clean up javadoc and parsing.
DTO Labs » rundeck #47 SUCCESS |
fix args option parsing for #201
Using a simple bash script as follows:
I have defined an option (named "option1") with no default value and no restrictions, so the user can enter any value.
In the job definition, I invoke the command
If the value entered by the user does not start with a dash, the program receives it correctly; if it starts with a dash, the programs receives the string "true". This looks like a pretty serious bug to me, unless I'm misunderstanding something (which of course is possible).
I'm also having trouble running the same job from the command line, I'll open a separate issue for that.