misc/189246: ssh-copy-id contains a syntax error
Dan McGregor
dan.mcgregor at usask.ca
Fri May 2 15:30:00 UTC 2014
>Number: 189246
>Category: misc
>Synopsis: ssh-copy-id contains a syntax error
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri May 02 15:30:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator: Dan McGregor
>Release: 10.0-STABLE
>Organization:
>Environment:
FreeBSD shadrach.dyndns.org 10.0-STABLE FreeBSD 10.0-STABLE #29 r264456: Mon Apr 14 08:00:01 CST 2014 dan at shadrach.dyndns.org:/usr/obj/usr/src/sys/SHADRACH amd64
>Description:
ssh-copy-id contains a syntax error in the script it sends to the remote end. It certainly affects bash and zsh. It appears like so:
% ssh-copy-id root at beaglebone.local
zsh:12: parse error near `if'
or with bash:
% ssh-copy-id root at beaglebone.local
/bin/sh: -c: line 11: syntax error near unexpected token `if'
/bin/sh: -c: line 11: ` if [ -x /sbin/restorecon ]; then \'
The tested versions were zsh version 5.0.5 and bash version 4.3.0
>How-To-Repeat:
Have a remote machine with either bash or zsh as /bin/sh
>Fix:
The attached patch fixes it.
Patch attached with submission follows:
Index: usr.bin/ssh-copy-id/ssh-copy-id.sh
===================================================================
--- usr.bin/ssh-copy-id/ssh-copy-id.sh (révision 265225)
+++ usr.bin/ssh-copy-id/ssh-copy-id.sh (copie de travail)
@@ -45,7 +45,7 @@
if ! grep -sqwF "$key" "$keyfile"; then \
printf "$alg $key $comment\n" >> "$keyfile" ; \
fi ; \
- done \
+ done ; \
if [ -x /sbin/restorecon ]; then \
/sbin/restorecon -F "$HOME/.ssh/" "$keyfile" >/dev/null 2>&1 || true ; \
fi
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list