X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/c66095e6a204cca299fd1ce129eaa1ea2c773de0..d2204ed1a0eb3ea915d866ba10b7e36481774f9f:/etc/zsh/.zprofile diff --git a/etc/zsh/.zprofile b/etc/zsh/.zprofile index c66bfb5..5b5870f 100644 --- a/etc/zsh/.zprofile +++ b/etc/zsh/.zprofile @@ -179,11 +179,11 @@ if [[ ! -v _sev_setup_ssh ]] { if [[ -f $e ]] { IFS=$'\0' read -r sock pid <$e } - if [[ -S $sock && $pid > 0 ]] && kill -0 $pid >/dev/null 2>&1; then + if ([[ -S $sock && $pid > 0 ]] && kill -0 $pid >/dev/null 2>&1) { [[ -o interactive ]] && print -P "Reusing agent PID $pid%f" export SSH_AUTH_SOCK=$sock export SSH_AGENT_PID=$pid - else + } else { # TODO: ensure ssh-agent path looks legit to avoid unsafe eval? # XXX: doesn't appear to be any other way to handle redirection. # because eval needs to write to current scope environment @@ -198,7 +198,7 @@ if [[ ! -v _sev_setup_ssh ]] { } echo -En - $SSH_AUTH_SOCK$'\0'$SSH_AGENT_PID >!$e unset c - fi + } unset okc e sock pid } elif [[ ! -v SSH_AUTH_SOCK && -v commands[gpg] ]] { # since gpg should have been started above, just export and notify