openssh continues to process dash arguements after hostname

Mark Andrews Mark_Andrews at isc.org
Wed Apr 28 14:02:33 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.

	Most people expect the flags to appear *before* the main
	arguements, if any.  This is normal command line processing.
	rsh (and hence ssh) break this convention.  The fact that
	the convention is broken should be documented.

> > 	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.

	No.  It was claimed  that it was for compatability with
	rsh.  Accepting flags on both side breaks compatibility.

	"rsh -l user hostname -foo" will attempt to execute "-foo"
	"ssh -l user hostname -foo" will attempt to process "-foo" as
	flags.
	
> 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
> 
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark_Andrews at isc.org




More information about the openssh-unix-dev mailing list