diff --git a/usr/lib/security-misc/permission-hardening b/usr/lib/security-misc/permission-hardening index 76e2638..05906ed 100755 --- a/usr/lib/security-misc/permission-hardening +++ b/usr/lib/security-misc/permission-hardening @@ -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