From b7796a5334075d5fa538d7579003fde6287d7e6d Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Thu, 11 Jul 2024 11:04:22 +0200 Subject: [PATCH] Unify method to find SUID files --- usr/bin/permission-hardener | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr/bin/permission-hardener b/usr/bin/permission-hardener index 2e5df3d..1d4c868 100755 --- a/usr/bin/permission-hardener +++ b/usr/bin/permission-hardener @@ -60,10 +60,16 @@ add_nosuid_statoverride_entry() { local fso_to_process fso_to_process="${fso}" local should_be_counter - should_be_counter="$(find "${fso_to_process}" -perm /u=s,g=s | wc -l)" || true + should_be_counter=0 local counter_actual counter_actual=0 + local dummy_line + while read -r dummy_line; do + true "DEBUG: test would evaluate parse" "${dummy_line}" + should_be_counter=$((should_be_counter + 1)) + done < <(find "${fso_to_process}" -perm /u=s,g=s -print0 | xargs -I{} -0 stat -c "%n %a %U %G" {}) + local line while read -r line; do true "line: ${line}"