mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-07-27 21:35:27 -04:00
add sanity test: count if we really processed all files
This commit is contained in:
parent
e28da89253
commit
50b8f65490
1 changed files with 10 additions and 3 deletions
|
@ -18,11 +18,12 @@ echo_wrapper() {
|
||||||
|
|
||||||
add_nosuid_statoverride_entry() {
|
add_nosuid_statoverride_entry() {
|
||||||
fso_to_process="${fso_without_trailing_slash}/"
|
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
|
while read -r line; do
|
||||||
true "line: $line"
|
true "line: $line"
|
||||||
counter="$(( counter + 1 ))"
|
counter_actual="$(( counter_actual + 1 ))"
|
||||||
|
|
||||||
arr=($line)
|
arr=($line)
|
||||||
|
|
||||||
|
@ -123,7 +124,13 @@ add_nosuid_statoverride_entry() {
|
||||||
## https://forums.whonix.org/t/kernel-hardening/7296/326
|
## https://forums.whonix.org/t/kernel-hardening/7296/326
|
||||||
done < <( find "$fso_to_process" -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'"
|
## 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() {
|
set_file_perms() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue