mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-07-07 00:43:56 +07:00
fix missing processing files bug
https://forums.whonix.org/t/permission-hardening/8655/16
This commit is contained in:
@ -19,11 +19,32 @@ 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
|
counter=0
|
||||||
|
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
true "line: $line"
|
true "line: $line"
|
||||||
counter="$(( counter + 1 ))"
|
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
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user