[Bug 249706] Re: ssh-copy-id fails when run with colon (:)

Colin Watson cjwatson at canonical.com
Thu Oct 9 12:55:27 BST 2008

As I said in the Debian BTS, perhaps ssh itself should do this, rather
than ssh-copy-id? You apparently ignored this comment. That said, that
seems to be fiddly and maybe isn't worth it.

Your patch introduces 'set -ex'. -e doesn't make any difference in this
code, and -x is noisy.

Your patch doesn't follow the indentation convention in that file. You
should always follow the prevailing convention.

It would be better just to strip colons at the end, rather than
throughout (which could produce very confusing results!). For that, just
replacing $1 with ${1%:} would be entirely sufficient; you don't need to
introduce another shell variable. (And why export HOSTNAME? Nothing
outside this script needs it.)

In future, consider writing this instead of introducing an unnecessary
call to the '[' program:

-if [ `echo "$1" |grep -c \: -` ]; then
+if echo "$1" | grep -q :; then

In the end, I've applied the attached patch to my Debian CVS repository.
Thanks for nudging this along.

** Attachment added: "249706.patch"

** Bug watch added: OpenSSH Portable Bugzilla #1530

** Also affects: openssh via
   Importance: Unknown
       Status: Unknown

** Changed in: openssh (Ubuntu)
     Assignee: (unassigned) => Colin Watson (kamion)
       Status: Triaged => In Progress

ssh-copy-id fails when run with colon (:)
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to openssh in ubuntu.

More information about the Ubuntu-server-bugs mailing list