[Bug 1980] use updated ssh-copy-id

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Fri Feb 15 10:49:20 EST 2013


https://bugzilla.mindrot.org/show_bug.cgi?id=1980

--- Comment #20 from Philip Hands <phil at hands.com> ---
(In reply to comment #19)
> > > >  67 GETOPT_PARSED=$(getopt --options 'i::p:nh?' --name "$0" --quiet -- "$@")
> > > 
> > > Would it be possible to pass -o [arg] though to ssh? Quite a few
> > > people have requested this over the years.
> > 
> > I presume that will need to be properly quoted in order to be passed
> > through, and that they may want to specify more than one -o option.
> 
> I don't think so, you just need to retain -o's argument and pass the
> whole mass through quoted. E.g.
> 
>     -o)
>         PORTOPTION="\"-o$2"\ "
>       shift 2
>       ;;
>
> should do it.

I'm presuming that was meant to be:

  PORTOPTION="\"-o$2\" "

or in fact, probably SSH_O_OPTS=...

Anyway, I cannot get that quoting to work -- it seems to leave the
quotes in and then use it as a hostname -- I've tried a few variations
with no luck so far.

Also, I'd say (assuming the quoting worked) that it should actually be
something like the following, in order to allow -o to be specified more
than once:

  SSH_OPTS="$SSH_OPTS \"-o$2\""

with the -p option similarly doing:

  SSH_OPTS="$SSH_OPTS -p $2"

and replacing PORTOPTION with SSH_OPTS throughout.

I'm also mildly concerned about how appropriate the -o options that
people specify are going to be for the diagnostic probes, and other ssh
calls.  I'm assuming that they'll be harmless, and perhaps essential,
so should be added to every ssh call in the script.

anyway, here's the failed attempt at that patch -- suggestions as to
how to make the quoting work properly would be welcome:

http://git.hands.com/ssh-copy-id?p=ssh-copy-id.git;a=commitdiff;h=79ea2824f05cf3c1491231e9acf5faa3cc415221

> > > I think populate_new_ids() might need a umask call too.
> > 
> > Do you mean 0022 in case they have something silly set, or 0177 or
> > some
> > such for reasons of paranoia?
> 
> paranoia ;)

Fair enough, I've added that.

Cheers, Phil.t

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list