Uh oh!
There was an error while loading. Please reload this page.
support commands/users/groups/directories with spaces or other shell characters - #451
support commands/users/groups/directories with spaces or other shell characters#451grosser wants to merge 1 commit into
Conversation
f0124b7 to
18e44f9Comparemattbrictson
commented
Feb 19, 2019
This is a breaking change to the behavior of SSHKit. I won't be able to accept this PR as is. However there are still improvements here that I can definitely get behind, if you'd like to split them off into another PR. For example I like replacing the Also, how about adding to the documentation instead of changing the behavior? For example the docs could offer advice about using capture"sh","-c","touch 1 && echo 1".shellescape |
grosser
commented
Feb 19, 2019
Afaik ruby convention is that passing arrays to system calls is supposed to escape them, that's how system/exec/sh/IO.popen etc work. Not doing that is also violating the users expectation:
Agreed that this is not a simple patch, and will need a minor or major bump, but I think it's the obvious/expected way it should work, otherwise it's just "random bugs" since things like adding a user/group will suddenly change what the command means. (also |
grosser
commented
Feb 19, 2019
#452 for just the sprintf change |
grosser
commented
Feb 19, 2019
/cc @leehambley since your name is all over command.rb :D |
grosser
commented
Feb 19, 2019
#453 for just the things I'd consider bugfixes |
mattbrictson
commented
Feb 19, 2019
I don't think the comparison holds up exactly. In Ruby's Arguments about "correctness" aside, SSHKit is a mature library (it has been >5 years since 1.0.0) and as a maintainer I personally place more value on keeping existing users happy and free from surprising changes. I will defer to @leehambley since he probably has more experience in this particular area. Thanks for splitting up into separate PRs. 👍 |
this should execute "sh -c touch\ 1 &&\ echo\ 1" and not
sh -c touch 1andecho 1... same issue for directories/users/groups
... also making user and group use the same form of escaping
... I'm pretty sure
nohupshould also dosh -cto avoid funky issues/fyi @eatwithforks@adammw@jonmoter this is why we saw crazy issues :D
... cap-devs, please let me know if this looks correct, or if I understood something wrong