ssh "bash -c" bug
Alex Bligh
alex at alex.org.uk
Fri Feb 22 02:38:35 EST 2013
On 21 Feb 2013, at 13:54, Peter Stuge wrote:
> Alex Bligh wrote:
>> I'd like a command line flag that says 'take argv[] as separate
>> parameters, do not fold spindle or mutilate, and pass those
>> completely unchanged to exec on the remote end as separate
>> parameters'.
>
> Please study the SSH protocol.
I'm unaware of anything in the ssh protocol which would prevent
this (assuming I want to do exactly what I said, just exec
a command) and indeed I'm pretty sure one could write it
as a trivial wrapper. For instance I could run a program which takes
a NULL terminated set of argv[] entries, followed by a further
NULL, on stdin, then passes the fd to the exec()'d program.
The client side wrapper would to do the opposite. ssh itself
would just see the wrapper being executed.
Why would my proposal require a change to the ssh protocol? It's
executing one binary, which snarfs something from stdin then
runs exec().
If the answer is 'it doesn't, then why would this be impossible
using a flag plus helper binary server side?
--
Alex Bligh
More information about the openssh-unix-dev
mailing list