mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 00:39:02 +00:00
More secure deletion and cannot delete path
This commit is contained in:
@@ -184,9 +184,8 @@ is_whitelisted() {
|
||||
|
||||
for existing in "${CURRENT_WHITELIST_PATTERNS[@]}"; do
|
||||
local existing_expanded="${existing/#\~/$HOME}"
|
||||
# Support both exact match and glob pattern match
|
||||
# shellcheck disable=SC2053
|
||||
if [[ "$check_pattern" == "$existing_expanded" ]] || [[ $check_pattern == $existing_expanded ]]; then
|
||||
# Only use exact string match to prevent glob expansion security issues
|
||||
if [[ "$check_pattern" == "$existing_expanded" ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user