Merge pull request #308 from maybebyte/permission-hardener-speedboost

perf(permission-hardener): optimize string match
This commit is contained in:
Patrick Schleizer 2025-05-27 10:58:50 -04:00 committed by GitHub
commit 395169fbce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -256,8 +256,7 @@ check_nosuid_whitelist() {
[[ " ${policy_exact_white_list[*]} " =~ " ${target_file} " ]] && return 1
for match_white_list_entry in "${policy_match_white_list[@]:-}"; do
if safe_echo "${target_file}" \
| grep --quiet --fixed-strings -- "${match_white_list_entry}"; then
if [[ "${target_file}" == *"${match_white_list_entry}"* ]]; then
return 1
fi
done