From 24b6155d21d9dc1d0726c3d2c57621e4dcd594c5 Mon Sep 17 00:00:00 2001 From: eadler Date: Sat, 1 Mar 2014 03:36:46 +0000 Subject: ssh-copy-id: add restorecon call In certain situations when creating an authorized_key file on a Linux machine restorecon(1) may need to be called. Therefore, attempt to run it if it exists. MFC After: 1 week Idea from: https://bugzilla.redhat.com/show_bug.cgi?id=739989 --- usr.bin/ssh-copy-id/ssh-copy-id.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'usr.bin') diff --git a/usr.bin/ssh-copy-id/ssh-copy-id.sh b/usr.bin/ssh-copy-id/ssh-copy-id.sh index 789fbe6..e16cfaa 100755 --- a/usr.bin/ssh-copy-id/ssh-copy-id.sh +++ b/usr.bin/ssh-copy-id/ssh-copy-id.sh @@ -46,6 +46,9 @@ sendkey() { printf "$alg $key $comment\n" >> "$keyfile" ; \ fi ; \ done \ + if [ -x /sbin/restorecon ]; then \ + /sbin/restorecon -F "$HOME/.ssh/" "$keyfile" >/dev/null 2>&1 || true ; \ + fi '\' } -- cgit v1.1