From: Jakub Jelen Date: Tue, 29 Sep 2020 10:00:01 +0000 (+0000) Subject: restorecon the correct directory X-Git-Tag: V_8_5_P1~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=333e25f7bc43cee6e36f766e39dad6f9918b318c;p=thirdparty%2Fopenssh-portable.git restorecon the correct directory if using different path for authorized_keys file SSH-Copy-ID-Upstream: 791a3df47b48412c726bff6f7b1d190721e65d51 --- diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id index cd1835c1e..3105e78be 100644 --- a/contrib/ssh-copy-id +++ b/contrib/ssh-copy-id @@ -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 )