openssh continues to process dash arguements after hostname

Ben Lindstrom mouring at etoh.eviladmin.org
Wed Apr 28 13:20:43 EST 2004



On Wed, 28 Apr 2004, Mark Andrews wrote:

>
> > 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...
>
> 	Well document the behaviour.  You will get less complaints
> 	that way.
>

I've been around here for a while now.. (Not as long as some, but enough)
And you are the first one to complaint about this.

> 	ssh hostname | user at hostname [-afgknqstvxACNTX1246]
> 	 [ -b bind_address] [-c cipher_spec] [-e escape_char]
> 	 [-i identity_file] [-l login_name] [-m mac_spec] [-o option]
> 	 [-p port] [-F configfile] [-L port:host:hostport] [-R
> 	 port:host:hostport] [-D port] [command]
>

Which of course is still wrong.  since the arguments can come before and
after hostname/user at hostname at this current time.  In fact if I wanted to
whine about your structure for explaining to me how ssh works I could
easily complain that -e could come before -c and -a could come after -o
and thus it still lies.  But honestly, most people realize that.


> 	Also if you want to be compatible with rlogin/rsh then be
> 	compatible.  Flags should only be accepted on one side of
> 	the hostname not both.
>

Accepting flags on the right hand side supports rsh's old command line
stuff.  No one said we are restraining ourselves to the old rlogin/rsh
way.

I don't get what you are making such a big fuss out of this.  I can think
of a lot more pressing issues then this whining.

What are you the command line argument police?   =)

- Ben




More information about the openssh-unix-dev mailing list