]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
restorecon the correct directory
authorJakub Jelen <jjelen@redhat.com>
Tue, 29 Sep 2020 10:00:01 +0000 (10:00 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 25 Feb 2021 14:06:15 +0000 (01:06 +1100)
if using different path for authorized_keys file

SSH-Copy-ID-Upstream: 791a3df47b48412c726bff6f7b1d190721e65d51

contrib/ssh-copy-id

index cd1835c1e223683a57c1a1931359a9d2c87d29bf..3105e78befe9f2d3b492bbf816afa1fd48289deb 100644 (file)
@@ -256,7 +256,7 @@ installkeys_sh() {
          cat >> ${AUTH_KEY_FILE} ||
          exit 1;
        if type restorecon >/dev/null 2>&1; then
-         restorecon -F .ssh ${AUTH_KEY_FILE};
+         restorecon -F $(dirname "${AUTH_KEY_FILE}") ${AUTH_KEY_FILE};
        fi
 EOF
   )