forked from extern/SSH-Snake
Empty resolved file is not allowed.
This commit is contained in:
parent
940a0a9152
commit
1e965466e4
@ -596,6 +596,7 @@ unresolved_key_file="$1"
|
||||
[[ -v 'priv_keys_files["$unresolved_key_file"]' || ${#priv_keys_files["$unresolved_key_file"]} -gt 0 ]] && return 0
|
||||
[[ -v 'key_files["$unresolved_key_file"]' || ${#key_files["$unresolved_key_file"]} -gt 0 ]] && return 1
|
||||
key_file="$(${s} readlink -f -- "$unresolved_key_file" 2>/dev/null)"
|
||||
[[ -z "$key_file" ]] && key_files["$unresolved_key_file"]=1 && return 1
|
||||
[[ -v 'priv_keys_files["$key_file"]' || ${#priv_keys_files["$key_file"]} -gt 0 ]] && priv_keys_files["$unresolved_key_file"]=1 && return 0
|
||||
[[ -v 'key_files["$key_file"]' || ${#key_files["$key_file"]} -gt 0 ]] && key_files["$unresolved_key_file"]=1 && return 1
|
||||
key_files["$unresolved_key_file"]=1
|
||||
|
2
Snake.sh
2
Snake.sh
@ -1020,6 +1020,8 @@ check_and_populate_keys() {
|
||||
|
||||
key_file="$(${s} readlink -f -- "$unresolved_key_file" 2>/dev/null)" # use sudo because it may be a symlink in a priviliged location, not that it would really matter (ssh will just use the symlink)
|
||||
|
||||
[[ -z "$key_file" ]] && key_files["$unresolved_key_file"]=1 && return 1
|
||||
|
||||
[[ -v 'priv_keys_files["$key_file"]' || ${#priv_keys_files["$key_file"]} -gt 0 ]] && priv_keys_files["$unresolved_key_file"]=1 && return 0
|
||||
[[ -v 'key_files["$key_file"]' || ${#key_files["$key_file"]} -gt 0 ]] && key_files["$unresolved_key_file"]=1 && return 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user