This is the mail archive of the
mailing list for the Cygwin project.
Re: 2004-Feb-17 snapshot change ssh option parsing behavior
- From: Wayne Davison <wayned at users dot sourceforge dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 20 Feb 2004 10:08:47 -0800
- Subject: Re: 2004-Feb-17 snapshot change ssh option parsing behavior
- References: <email@example.com>
Corinna Vinschen wrote:
> We're using the latest plain BSD getopt() now. It's permuting the
> options by default. This was switched off by default in Cygwin so
> Typically you should quote the command you send to the remote host:
> ssh somehost '/bin/bash --login -c date'
This is not something that other OSes require, and programs such as
rsync are broken by this change. While trying to work around this
problem, I tried using a remote-shell option of "ssh --" with rsync,
but ssh still doesn't do the right thing with that either. You can
observe the mangled result by inserting an "echo" in the command that
% ssh -- host echo rsync --server -vlogDtpr . destdir/
rsync -vlogDtpr . destdir/
Notice how the "--server" option was dropped! Without the echo, this
results in starting up a remote local-copy rsync command. I'm just
lucky that I hadn't specified a --delete option, or this bug could have
devestated my home dir on the remote system.
Reordering the two options above causes ssh to switch to verbose mode
and try to log-in as "ogDtpr", so it appears to be erroneously parsing
that first rsync option even when "--" is used (which may well be a bug
in the BSD getopt routine).
Yes, setting the POSIXLY_CORRECT environment variable fixes this.
I think that ssh should not reorder its options -- it's just too
disruptive of a change in behavior.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html