Quote zero-length strings in arguments#1551
Merged
Merged
Conversation
If a zero-length string is passed, it does not get properly quoted, and then it is not properly passed to the child process
|
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
Owner
|
I'll fix this commit message on merge. What was the case that caused this to be a bug (out of interest)? |
Contributor
Author
|
I have a tool that uses nodemon to launch a wrapper around an api, where, to be lazy, I just use the position of arguments rather than any kind of arg parsing. I pass empty args to indicate that they're not set. The code looks like this: const args = [pkg, argv.entryFile || '', argv.api || '', argv.configFile || '']
const nodemonConfig = {
script: resolve('.runner-build/index.js'),
args,
stdout: true,
delay: 0.5,
ignore,
}
if (argv.runnerWatch) {
nodemonConfig.watch = ['.', resolve('.runner-build')]
}
const n = nodemon(nodemonConfig)Hope that makes sense! |
This was referenced Feb 12, 2020
This was referenced Apr 1, 2020
This was referenced Apr 24, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a zero-length string is passed, it does not get properly quoted, and then it is not properly passed to the child process
I noticed this issue when using nodemon to monitor a wrapper script, where i basically pass a bunch of arguments like function arguments.
TODO: update the commit message to fit your convention. I just did this quickly in the github editor.