mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-10-01 08:25:45 -04:00
add sanity test: count if we really processed all files
This commit is contained in:
parent
e28da89253
commit
50b8f65490
@ -18,11 +18,12 @@ echo_wrapper() {
|
||||
|
||||
add_nosuid_statoverride_entry() {
|
||||
fso_to_process="${fso_without_trailing_slash}/"
|
||||
counter=0
|
||||
should_be_counter="$(find "$fso_to_process" | wc -l)"
|
||||
counter_actual=0
|
||||
|
||||
while read -r line; do
|
||||
true "line: $line"
|
||||
counter="$(( counter + 1 ))"
|
||||
counter_actual="$(( counter_actual + 1 ))"
|
||||
|
||||
arr=($line)
|
||||
|
||||
@ -123,7 +124,13 @@ add_nosuid_statoverride_entry() {
|
||||
## https://forums.whonix.org/t/kernel-hardening/7296/326
|
||||
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'"
|
||||
## Sanity test.
|
||||
if [ ! "$should_be_counter" = "$counter_actual" ]; then
|
||||
echo "INFO: fso_to_process: '$fso_to_process' | counter_actual : '$counter_actual'"
|
||||
echo "INFO: fso_to_process: '$fso_to_process' | should_be_counter: '$should_be_counter'"
|
||||
exit_code=202
|
||||
echo "ERROR: counter does not check out." >&2
|
||||
fi
|
||||
}
|
||||
|
||||
set_file_perms() {
|
||||
|
Loading…
Reference in New Issue
Block a user