mirror of
https://github.com/MegaManSec/SSH-Snake.git
synced 2024-12-04 12:23:08 +01:00
Empty key location is also not allowed.
This commit is contained in:
parent
d803989131
commit
940a0a9152
@ -592,6 +592,7 @@ local unresolved_key_file
|
||||
local key_file
|
||||
local ignored_key_file
|
||||
unresolved_key_file="$1"
|
||||
[[ -z "$unresolved_key_file" ]] && return 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)"
|
||||
|
2
Snake.sh
2
Snake.sh
@ -1012,6 +1012,8 @@ check_and_populate_keys() {
|
||||
|
||||
unresolved_key_file="$1"
|
||||
|
||||
[[ -z "$unresolved_key_file" ]] && return 1
|
||||
|
||||
# Avoid the readlink call if the path is already absolute.
|
||||
[[ -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
|
||||
|
Loading…
Reference in New Issue
Block a user