Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Mar 2014 03:36:46 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262647 - head/usr.bin/ssh-copy-id
Message-ID:  <201403010336.s213akr5042620@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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
 	'\' 
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403010336.s213akr5042620>