Skip to content

Commit

Permalink
fix(ssh-agent): add identity only if identity exists (#12371)
Browse files Browse the repository at this point in the history
  • Loading branch information
zikoengxi committed Apr 22, 2024
1 parent 0c80a06 commit 67581c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/ssh-agent/ssh-agent.plugin.zsh
Expand Up @@ -62,7 +62,7 @@ function _add_identities() {
# if id is an absolute path, make file equal to id
[[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id"
# check for filename match, otherwise try for signature match
if [[ ${loaded_ids[(I)$file]} -le 0 ]]; then
if [[ -f $file && ${loaded_ids[(I)$file]} -le 0 ]]; then
sig="$(ssh-keygen -lf "$file" | awk '{print $2}')"
[[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file")
fi
Expand Down

0 comments on commit 67581c5

Please sign in to comment.