mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 17:24:45 +00:00
fix: Respect whitelisted subdirectories
This commit is contained in:
@@ -605,6 +605,13 @@ is_path_whitelisted() {
|
||||
[[ "$normalized_target" == $check_pattern ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if target is a parent directory of a whitelisted path
|
||||
# e.g., if pattern is /path/to/dir/subdir and target is /path/to/dir,
|
||||
# the target should be protected to preserve its whitelisted children
|
||||
if [[ "$check_pattern" == "$normalized_target"/* ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user