Author: eadler
Date: Sat Mar  1 03:36:46 2014
New Revision: 262647
URL: http://svnweb.freebsd.org/changeset/base/262647

Log:
  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

Modified:
  head/usr.bin/ssh-copy-id/ssh-copy-id.sh

Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh
==============================================================================
--- head/usr.bin/ssh-copy-id/ssh-copy-id.sh     Sat Mar  1 03:17:58 2014        
(r262646)
+++ head/usr.bin/ssh-copy-id/ssh-copy-id.sh     Sat Mar  1 03:36:46 2014        
(r262647)
@@ -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
        '\' 
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to