summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2020-09-29 10:00:01 +0000
committerDarren Tucker <dtucker@dtucker.net>2021-02-26 01:06:15 +1100
commit333e25f7bc43cee6e36f766e39dad6f9918b318c (patch)
tree2c63e05166b7c4d6dc0d6eb29502948b2792af83
parent9beeab8a37a49a9e3ffb1972fff6621ee5bd7a71 (diff)
restorecon the correct directory
if using different path for authorized_keys file SSH-Copy-ID-Upstream: 791a3df47b48412c726bff6f7b1d190721e65d51
-rw-r--r--contrib/ssh-copy-id2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
index cd1835c1..3105e78b 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
)