-
Notifications
You must be signed in to change notification settings - Fork 116
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
Quotes in sudo commands should be escaped #99
Comments
This is actually surprisingly hard. Bash sucks... http://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings |
This is indeed rather hard. I wrote quite a lot of shell scripts, maybe I can tackle this at some point. |
This would be enough: function escapeShellArg (cmd) {
return '\'' + cmd.replace(/\'/g, "'\\''") + '\'';
} Ref: http://stackoverflow.com/questions/1779858/how-do-i-escape-a-string-for-a-shell-command-in-node |
@zxqfox this seems to be the correct solution indeed. Will try to get a new release ready soon. |
It looks like the fix for this (specifically the removal of the -c flag) has introduced an error in a portion of our deployment process that uses the sudo functionality to run "chown" on the remote machine. Code is as follows:
In 0.6.4 this works as expected. In 0.6.5 it fails with a |
Hey @cmckendry what's |
I could verify the error, please ugprade to 0.6.6 which reverts the sudo command to the old behavior. Thanks for reporting. |
Confirmed, that fixed it. Thanks! |
In my flightplan, when I do:
I get an error:
The same command (
node -e 'console.log("hello")'
), when I try it in bash is valid and works fine.The text was updated successfully, but these errors were encountered: