Mark Andrews
2004-Apr-28 00:03 UTC
openssh continues to process dash arguements after hostname
Processing dash arguments after the hostname is inconsistant with getopt() usage. It is also inconsistant with other ssh/rsh implementations. It is also not documented. openssh accepts treats "ssh host -l user" as "ssh -l user host" when infact it should be attemption to execute "-l user" on "host" as the original user. It looks like someone wanted to be "compatible" with Linux's broken getopt() implementation.
Damien Miller
2004-Apr-28 00:51 UTC
openssh continues to process dash arguements after hostname
On Wed, 28 Apr 2004, Mark Andrews wrote:> > Processing dash arguments after the hostname is inconsistant with > getopt() usage. It is also inconsistant with other ssh/rsh > implementations. It is also not documented. > > openssh accepts treats "ssh host -l user" as "ssh -l user host" > when infact it should be attemption to execute "-l user" on "host" > as the original user.I agree that the current argument processing isn't standard, but I'm not sure that trying to "execute" - options on the server side is either. The commands are executed on the server with the user's shell, so any - arguments will be treated as arguments to that shell. If you really want this, you can use this patch: Index: ssh.c ==================================================================RCS file: /cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.212 diff -u -r1.212 ssh.c --- ssh.c 27 Apr 2004 09:46:37 -0000 1.212 +++ ssh.c 28 Apr 2004 00:47:40 -0000 @@ -449,10 +449,6 @@ host = ++cp; } else host = *av; - if (ac > 1) { - optind = optreset = 1; - goto again; - } ac--, av++; }
Markus Friedl
2004-Apr-28 00:59 UTC
openssh continues to process dash arguements after hostname
On Wed, Apr 28, 2004 at 10:03:52AM +1000, Mark Andrews wrote:> > Processing dash arguments after the hostname is inconsistant with > getopt() usage. It is also inconsistant with other ssh/rsh > implementations. It is also not documented. > > openssh accepts treats "ssh host -l user" as "ssh -l user host" > when infact it should be attemption to execute "-l user" on "host" > as the original user. > > It looks like someone wanted to be "compatible" with Linux's > broken getopt() implementation.no. original ssh tried to be compatible with rlogin, and since hundreds of scripts may rely on the current behaviour...
Reasonably Related Threads
- how to use expression as function arguements?
- wrong number of arguements (1 for 0) on ActiveRecord::Base#send
- Specifying arguements in user defined functions
- A question about logical controls and function arguements
- failed to add domain dn= sambaDomainName=hostname