Philipp Marek
2016-Feb-12 11:34 UTC
Arguments, whitespace, splitting, and shells (& compatibility)
Quite some time ago there was a bit of discussion whether SSH can change it's (information-destroying) way of passing commands to the remote host (whitespace in an argument gets split up, too). [[To reproduce: # echo "yes no" yes no but # ssh <host> echo "yes no" yes no ]] For other problematic things, check "scp" for filenames containing spaces. Now, I'm well aware that the default for so many years can't be changed (easily); but how about a new option that repairs that behaviour? This way new scripts can just add that, and don't have to work around broken tools ;/ (sorry, but it's really cumbersome). I believe there was a patch already; googling found me the (a) old discussion at http://www.gossamer-threads.com/lists/openssh/dev/9249, but the patch (if it exists, perhaps I'm still misremembering) escaped me. Please, let's try to find a solution for that... if not for any other reasons, then to make "ssh" a simple cloud-provider, too ;) Thank you! Regards, Phil
Ángel González
2016-Feb-20 23:31 UTC
Arguments, whitespace, splitting, and shells (& compatibility)
On 12/02/16 12:34, Philipp Marek wrote:> Quite some time ago there was a bit of discussion whether SSH can change > it's (information-destroying) way of passing commands to the remote host > (whitespace in an argument gets split up, too). > > [[To reproduce: > # echo "yes no" > yes no > but > # ssh<host> echo "yes no" > yes no > ]] > > For other problematic things, check "scp" for filenames containing spaces.Note that ssh is supposed to accept a single argument (but all of us abuse that several parameters are passed to the remote side ?).> Now, I'm well aware that the default for so many years can't be changed > (easily); but how about a new option that repairs that behaviour? This > way new scripts can just add that, and don't have to work around broken > tools ;/ (sorry, but it's really cumbersome). > > > I believe there was a patch already; googling found me the (a) old > discussion at http://www.gossamer-threads.com/lists/openssh/dev/9249, > but the patch (if it exists, perhaps I'm still misremembering) escaped > me. > > > Please, let's try to find a solution for that... > if not for any other reasons, then to make "ssh" a simple cloud-provider, too ;)A new option seems about the right way to fix it, since the local ssh would need to know the kind of shell used by the remote system. But if it had a configuration option: RemoteShellQuoting POSIX it could add its own quoting to preserve all the received arguments when passed to a POSIX shell. It should be simple to code. Best regards