Author: eadler
Date: Wed Jun 13 06:46:00 2012
New Revision: 236999
URL: http://svn.freebsd.org/changeset/base/236999

Log:
  Include a warning when using the example code as it may not
  work in unusual situations.
  Also slightly optimize the command.
  
  Submitted by: Jeremy Chadwick j...@koitsu.org
  Approved by:  cperciva (implicit)
  MFC after:    1 week

Modified:
  head/share/examples/csh/dot.cshrc

Modified: head/share/examples/csh/dot.cshrc
==============================================================================
--- head/share/examples/csh/dot.cshrc   Wed Jun 13 06:42:36 2012        
(r236998)
+++ head/share/examples/csh/dot.cshrc   Wed Jun 13 06:46:00 2012        
(r236999)
@@ -4,8 +4,12 @@
 #
 
 # Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running
+#
+# This has a couple caveats, the most notable being that if a user
+# has multiple ssh-agent(1) processes running, this will very likely
+# set SSH_AUTH_SOCK to point to the wrong file/domain socket.
 if (${?SSH_AUTH_SOCK} != "1") then
-       setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { 
print $6 }'`
+       setenv SSH_AUTH_SOCK `sockstat -u | awk '/^${USER}.+ ssh-agent/ { print 
$6 }'
 endif
 
 # Change only root's prompt
_______________________________________________
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