count processed file system objects

to be able to verify if any were "forgotten"
This commit is contained in:
Patrick Schleizer 2019-12-20 08:54:56 -05:00
parent 195ea522f5
commit fbe2479f48
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -17,8 +17,11 @@ echo_wrapper() {
} }
add_nosuid_statoverride_entry() { add_nosuid_statoverride_entry() {
fso_to_process="${fso_without_trailing_slash}/"
counter=0
while read -r line; do while read -r line; do
true "line: $line" true "line: $line"
counter="$(( counter + 1 ))"
if ! read -r file_name existing_mode owner group; then if ! read -r file_name existing_mode owner group; then
echo "ERROR: cannot parse line by 'stat' - line: '$line'" >&2 echo "ERROR: cannot parse line by 'stat' - line: '$line'" >&2
continue continue
@ -97,7 +100,9 @@ add_nosuid_statoverride_entry() {
## /lib will hit ARG_MAX. ## /lib will hit ARG_MAX.
## https://forums.whonix.org/t/kernel-hardening/7296/326 ## 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() { set_file_perms() {