openssh continues to process dash arguements after hostname
Mark Andrews
Mark_Andrews at isc.org
Wed Apr 28 11:45:01 EST 2004
> 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.
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]
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.
From rsh.c:
/* handle "rsh host flags" */
if (!host && argc > 2 && argv[1][0] != '-') {
host = argv[1];
argoff = 1;
}
--
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