add sanity test for file_name output from stat

This commit is contained in:
Patrick Schleizer 2024-07-24 11:01:24 -04:00
parent b9dfe70a01
commit ced02fb9e0
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -97,6 +97,15 @@ add_nosuid_statoverride_entry() {
existing_owner="${arr[2]}"
existing_group="${arr[3]}"
if [ ! "$file_name" = "$file_name_from_stat" ]; then
log error "\
file_name is different from file_name_from_stat:
line: '${line}'
file_name '${file_name}'
file_name_from_stat: '${file_name_from_stat}'" >&2
continue
fi
if test -z "${existing_mode}"; then
log error "Existing mode is empty in line: ${line}" >&2
continue