From fbe2479f486add30cd29f5c4063a140c42c502fe Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Fri, 20 Dec 2019 08:54:56 -0500 Subject: [PATCH] count processed file system objects to be able to verify if any were "forgotten" --- usr/lib/security-misc/permission-hardening | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr/lib/security-misc/permission-hardening b/usr/lib/security-misc/permission-hardening index 1e3239e..76e2638 100755 --- a/usr/lib/security-misc/permission-hardening +++ b/usr/lib/security-misc/permission-hardening @@ -17,8 +17,11 @@ echo_wrapper() { } add_nosuid_statoverride_entry() { + fso_to_process="${fso_without_trailing_slash}/" + counter=0 while read -r line; do true "line: $line" + counter="$(( counter + 1 ))" if ! read -r file_name existing_mode owner group; then echo "ERROR: cannot parse line by 'stat' - line: '$line'" >&2 continue @@ -97,7 +100,9 @@ add_nosuid_statoverride_entry() { ## /lib will hit ARG_MAX. ## https://forums.whonix.org/t/kernel-hardening/7296/326 - done < <( find "${fso_without_trailing_slash}/" -print0 | xargs -I{} -0 stat -c "%n %a %U %G" {} ) + done < <( find "$fso_to_process" -print0 | xargs -I{} -0 stat -c "%n %a %U %G" {} ) + + echo "INFO: fso_to_process: '$fso_to_process' | counter: '$counter'" } set_file_perms() {