From owner-freebsd-bugs@FreeBSD.ORG Fri May 2 15:30:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABA1E317 for ; Fri, 2 May 2014 15:30:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88EF01501 for ; Fri, 2 May 2014 15:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s42FU0uq049632 for ; Fri, 2 May 2014 15:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s42FU0Un049631; Fri, 2 May 2014 15:30:00 GMT (envelope-from gnats) Resent-Date: Fri, 2 May 2014 15:30:00 GMT Resent-Message-Id: <201405021530.s42FU0Un049631@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan McGregor Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31A612CA for ; Fri, 2 May 2014 15:27:33 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F51014E5 for ; Fri, 2 May 2014 15:27:33 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s42FRWAI089547 for ; Fri, 2 May 2014 15:27:32 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s42FRWMM089535; Fri, 2 May 2014 15:27:32 GMT (envelope-from nobody) Message-Id: <201405021527.s42FRWMM089535@cgiserv.freebsd.org> Date: Fri, 2 May 2014 15:27:32 GMT From: Dan McGregor To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/189246: ssh-copy-id contains a syntax error X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 15:30:00 -0000 >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@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@beaglebone.local zsh:12: parse error near `if' or with bash: % ssh-copy-id root@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: