mirror of
https://github.com/dcarrillo/prezto.git
synced 2026-04-18 13:24:04 +00:00
Make the persistent SSH authentication socket symlink creation atomic
This commit is contained in:
committed by
Indrajit Raychaudhuri
parent
a1c01ff39f
commit
4efeccfefc
@@ -34,7 +34,8 @@ fi
|
||||
# Create a persistent SSH authentication socket.
|
||||
if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then
|
||||
mkdir -p "$_ssh_agent_sock:h"
|
||||
ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock"
|
||||
ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock.$$"
|
||||
mv -f "$_ssh_agent_sock.$$" "$_ssh_agent_sock"
|
||||
export SSH_AUTH_SOCK="$_ssh_agent_sock"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user