[openssh-commits] [openssh] 05/11: Fix test error for /bin/sh on Solaris 10 and older

git+noreply at mindrot.org git+noreply at mindrot.org
Thu May 25 18:26:17 AEST 2023


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 914f4ad138714c471ba72fb6d5496b6235320edd
Author: Carlos Rodríguez Gili <carlos.rodriguez-gili at upc.edu>
Date:   Tue Apr 20 19:23:57 2021 +0200

    Fix test error for /bin/sh on Solaris 10 and older
    
    On Solaris 10 and older targets /bin/sh is not POSIX-compliant.
    Test -z `...` fails with error 'sh: test: argument expected'.
    Using quotes around backticks fixes this and doesn't break
    POSIX compatibility.
    
    SSH-Copy-ID-Upstream: 98394072a3f985b2650c1e8eab2fef84e38cc065
---
 contrib/ssh-copy-id | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
index 9c9b0fa5..171c4e06 100644
--- a/contrib/ssh-copy-id
+++ b/contrib/ssh-copy-id
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 # Copyright (c) 1999-2023 Philip Hands <phil at hands.com>
+#               2021 Carlos Rodríguez Gili <carlos.rodriguez-gili at upc.edu>
 #               2020 Matthias Blümel <blaimi at blaimi.de>
 #               2017 Sebastien Boyron <seb at boyron.eu>
 #               2013 Martin Kletzander <mkletzan at redhat.com>
@@ -259,7 +260,7 @@ installkeys_sh() {
 		AUTH_KEY_FILE=/etc/dropbear/authorized_keys;
 	AUTH_KEY_DIR=\`dirname "\${AUTH_KEY_FILE}"\`;
 	mkdir -p "\${AUTH_KEY_DIR}" &&
-		{ [ -z \`tail -1c "\${AUTH_KEY_FILE}" 2>/dev/null\` ] ||
+		{ [ -z "\`tail -1c "\${AUTH_KEY_FILE}" 2>/dev/null\`" ] ||
 			echo >> "\${AUTH_KEY_FILE}" || exit 1; } &&
 		cat >> "\${AUTH_KEY_FILE}" || exit 1;
 	if type restorecon >/dev/null 2>&1; then

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list