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

fix quotes for brimcap cli args #1598

Merged
merged 2 commits into from
May 1, 2021
Merged

fix quotes for brimcap cli args #1598

merged 2 commits into from
May 1, 2021

Conversation

mason-fish
Copy link
Contributor

fixes #1597

Signed-off-by: Mason Fish mason@looky.cloud

Signed-off-by: Mason Fish <mason@looky.cloud>
@mason-fish mason-fish requested a review from a team April 30, 2021 22:03
Comment on lines 66 to 72
this.binPath,
`"${this.binPath}"`,
subCommand,
...flatMap(
Object.entries(opts).map(([k, v]) => [`-${OPTION_NAME_MAP[k] || k}`, v])
Object.entries(opts).map(([k, v]) => [
`-${OPTION_NAME_MAP[k] || k}`,
`"${v}"`
])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go sideways if this.binPath or any opts value contains a quotation mark (very unlikely but possible). Make it bulletproof by switching from execSync to spawnSync!

Signed-off-by: Mason Fish <mason@looky.cloud>
@mason-fish mason-fish merged commit 3467710 into main May 1, 2021
@mason-fish mason-fish deleted the fix-brimcap-api-quotes branch May 1, 2021 00:03
philrz added a commit that referenced this pull request Jul 19, 2021
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.

"brimcap search" command line tripped up by paths containing space chars
3 participants