ssh "bash -c" bug

Phil Pennock phil.pennock at globnix.org
Thu Feb 21 19:15:41 EST 2013


On 2013-02-21 at 03:18 +0100, Peter Stuge wrote:
> Bob Proulx wrote:
> > Instead of confusing shell quoting I recommend piping the commands
> 
> ..must..avoid..learning..

The OP's shell quoting was absolutely correct, for pretty much any
command wrapper except OpenSSH's ssh (I haven't checked other
implementations).

If you join together an argument vector into a shell command-line, the
tool doing that should be taking adequate steps to quote individual
arguments as needed, so that they're preserved.

That ssh does not do so is a bug.  It's a bug that it's far too late to
fix now, but that doesn't change that the ssh(1) client is flawed here.

When there's a standard system, and one tool does things differently,
folks can learn the idiosyncrasies of the odd tools, or they can learn
that the tool is buggy and avoid the issue.  I recommend just learning
that it's different and avoiding the issue instead of trying to build up
an encyclopaedic knowledge of variances.

Bob's suggestions were good ones.

-Phil


More information about the openssh-unix-dev mailing list