fix missing processing files bug

https://forums.whonix.org/t/permission-hardening/8655/16
This commit is contained in:
Patrick Schleizer 2019-12-20 09:43:23 -05:00
parent fbe2479f48
commit 55faa7b997
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -19,11 +19,32 @@ 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
arr=($line)
file_name="${arr[0]}"
existing_mode="${arr[1]}"
owner="${arr[2]}"
group="${arr[3]}"
if [ "$file_name" = "" ]; then
echo "ERROR: file_name is empty. line: '$line'" >&2
continue
fi
if [ "$existing_mode" = "" ]; then
echo "ERROR: existing_mode is empty. line: '$line'" >&2
continue
fi
if [ "owner" = "" ]; then
echo "ERROR: $owner is empty. line: '$line'" >&2
continue
fi
if [ "$group" = "" ]; then
echo "ERROR: $group is empty. line: '$line'" >&2
continue
fi