diff options
author | eadler <eadler@FreeBSD.org> | 2012-06-13 06:46:00 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2012-06-13 06:46:00 +0000 |
commit | b15cbc2807377cb0ea0721766e07f5f168a2c25c (patch) | |
tree | 33fec61109cb92b4d638ce76a0b584b4336b5599 | |
parent | 028605e4f68c0dcc6e9f41e223bbabe022eeedb0 (diff) | |
download | FreeBSD-src-b15cbc2807377cb0ea0721766e07f5f168a2c25c.zip FreeBSD-src-b15cbc2807377cb0ea0721766e07f5f168a2c25c.tar.gz |
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 jdc@koitsu.org
Approved by: cperciva (implicit)
MFC after: 1 week
-rw-r--r-- | share/examples/csh/dot.cshrc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/share/examples/csh/dot.cshrc b/share/examples/csh/dot.cshrc index 175bfd2..5b30791 100644 --- a/share/examples/csh/dot.cshrc +++ b/share/examples/csh/dot.cshrc @@ -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 |