]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
use $AUTH_KEY_DIR, now that we have it
authorPhilip Hands <phil@hands.com>
Tue, 13 Oct 2020 12:12:58 +0000 (14:12 +0200)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 25 Feb 2021 14:06:15 +0000 (01:06 +1100)
since that was a change made since jjelen's commit was written

also, quote the variables

SSH-Copy-ID-Upstream: 588cd8e5cbf95f3443d92b9ab27c5d73ceaf6616

contrib/ssh-copy-id

index 3105e78befe9f2d3b492bbf816afa1fd48289deb..b8a67419b3ba1eba15de81a14606ef488b66b1dc 100644 (file)
@@ -252,11 +252,11 @@ installkeys_sh() {
        cd;
        umask 077;
        mkdir -p "${AUTH_KEY_DIR}" &&
-         { [ -z \`tail -1c ${AUTH_KEY_FILE} 2>/dev/null\` ] || echo >> ${AUTH_KEY_FILE}; } &&
-         cat >> ${AUTH_KEY_FILE} ||
+         { [ -z \`tail -1c ${AUTH_KEY_FILE} 2>/dev/null\` ] || echo >> "${AUTH_KEY_FILE}"; } &&
+         cat >> "${AUTH_KEY_FILE}" ||
          exit 1;
        if type restorecon >/dev/null 2>&1; then
-         restorecon -F $(dirname "${AUTH_KEY_FILE}") ${AUTH_KEY_FILE};
+         restorecon -F "${AUTH_KEY_DIR}" "${AUTH_KEY_FILE}";
        fi
 EOF
   )