mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 10:51:57 +00:00
fix(ssh-agent): fix check for running ssh-agent
process with hidepid /proc (#8492)
Fixes #8492
This commit is contained in:
parent
46f8765f4c
commit
f1dd97bb2a
1 changed files with 5 additions and 3 deletions
|
@ -6,9 +6,11 @@ function _start_agent() {
|
||||||
if [[ -f "$ssh_env_cache" ]]; then
|
if [[ -f "$ssh_env_cache" ]]; then
|
||||||
. "$ssh_env_cache" > /dev/null
|
. "$ssh_env_cache" > /dev/null
|
||||||
|
|
||||||
{
|
# Test if $SSH_AUTH_SOCK is visible
|
||||||
[[ "$USERNAME" = root ]] && command ps ax || command ps x
|
zmodload zsh/net/socket
|
||||||
} | command grep ssh-agent | command grep -q $SSH_AGENT_PID && return 0
|
if [[ -S "$SSH_AUTH_SOCK" ]] && zsocket "$SSH_AUTH_SOCK" 2>/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set a maximum lifetime for identities added to ssh-agent
|
# Set a maximum lifetime for identities added to ssh-agent
|
||||||
|
|
Loading…
Reference in a new issue