mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-09-26 11:29:04 +02:00
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
This commit is contained in:
parent
bd382dca31
commit
914f4ad138
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copyright (c) 1999-2023 Philip Hands <phil@hands.com>
|
# Copyright (c) 1999-2023 Philip Hands <phil@hands.com>
|
||||||
|
# 2021 Carlos Rodríguez Gili <carlos.rodriguez-gili@upc.edu>
|
||||||
# 2020 Matthias Blümel <blaimi@blaimi.de>
|
# 2020 Matthias Blümel <blaimi@blaimi.de>
|
||||||
# 2017 Sebastien Boyron <seb@boyron.eu>
|
# 2017 Sebastien Boyron <seb@boyron.eu>
|
||||||
# 2013 Martin Kletzander <mkletzan@redhat.com>
|
# 2013 Martin Kletzander <mkletzan@redhat.com>
|
||||||
@ -259,7 +260,7 @@ installkeys_sh() {
|
|||||||
AUTH_KEY_FILE=/etc/dropbear/authorized_keys;
|
AUTH_KEY_FILE=/etc/dropbear/authorized_keys;
|
||||||
AUTH_KEY_DIR=\`dirname "\${AUTH_KEY_FILE}"\`;
|
AUTH_KEY_DIR=\`dirname "\${AUTH_KEY_FILE}"\`;
|
||||||
mkdir -p "\${AUTH_KEY_DIR}" &&
|
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; } &&
|
echo >> "\${AUTH_KEY_FILE}" || exit 1; } &&
|
||||||
cat >> "\${AUTH_KEY_FILE}" || exit 1;
|
cat >> "\${AUTH_KEY_FILE}" || exit 1;
|
||||||
if type restorecon >/dev/null 2>&1; then
|
if type restorecon >/dev/null 2>&1; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user