]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
if unable to add a missing newline, fail
authorJakub Jelen <jjelen@redhat.com>
Tue, 29 Sep 2020 10:02:45 +0000 (10:02 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 25 Feb 2021 14:06:15 +0000 (01:06 +1100)
SSH-Copy-ID-Upstream: 76b25e18f55499ea9edb4c4d6dc4a80bebc36d95

contrib/ssh-copy-id

index b8a67419b3ba1eba15de81a14606ef488b66b1dc..5fee150763ab1e7cb834c42eb527bd7963cf2256 100644 (file)
@@ -252,7 +252,7 @@ installkeys_sh() {
        cd;
        umask 077;
        mkdir -p "${AUTH_KEY_DIR}" &&
-         { [ -z \`tail -1c ${AUTH_KEY_FILE} 2>/dev/null\` ] || echo >> "${AUTH_KEY_FILE}"; } &&
+         { [ -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