Browse Source

fix(ssh-agent): fix check for running `ssh-agent` process with hidepid /proc (#8492)

Fixes #8492
pull/10336/head
Marc Cornellà 1 month ago
parent
commit
f1dd97bb2a
No known key found for this signature in database GPG Key ID: 314585E776A9C1B
  1. 8
      plugins/ssh-agent/ssh-agent.plugin.zsh

8
plugins/ssh-agent/ssh-agent.plugin.zsh

@ -6,9 +6,11 @@ function _start_agent() {
if [[ -f "$ssh_env_cache" ]]; then
. "$ssh_env_cache" > /dev/null
{
[[ "$USERNAME" = root ]] && command ps ax || command ps x
} | command grep ssh-agent | command grep -q $SSH_AGENT_PID && return 0
# Test if $SSH_AUTH_SOCK is visible
zmodload zsh/net/socket
if [[ -S "$SSH_AUTH_SOCK" ]] && zsocket "$SSH_AUTH_SOCK" 2>/dev/null; then
return 0
fi
fi
# Set a maximum lifetime for identities added to ssh-agent

Loading…
Cancel
Save