View Issue Details

IDProjectCategoryView StatusLast Update
0000253fileGeneralpublic2021-04-19 19:04
Reporterrwmjones Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.40 
Fixed in Version5.41 
Summary0000253: file 5.40 can no longer print ext4 filesystem UUIDs correctly.
Descriptionfile 5.40 can no longer print ext4 filesystem UUIDs correctly.

Reported in Fedora:
file-5.40-1.fc35.x86_64

Downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1945122
Steps To Reproduce1. Prepare a disk image in a file:

  $ rm /var/tmp/test.img
  $ truncate -s 1G /var/tmp/test.img
  $ mkfs.ext4 /var/tmp/test.img

2. Run 'file' against it to display the UUID.

With the previous version of file it would display the UUID correcctly, eg:

  $ file /var/tmp/test.img
  /var/tmp/test.img: Linux rev 1.0 ext4 filesystem data, UUID=b1bc22cc-7392-4780-8b50-77dac556236d (extents) (64bit) (large files) (huge files)

With the current version of file it displays it incorrectly, eg:

  $ file /var/tmp/test.img
  /var/tmp/test.img: Linux rev 1.0 ext4 filesystem data, UUID=b1bc22cc-7392-4780-ffff8b50-77dac556236d (extents) (64bit) (large files) (huge files)

Notice that some parts of the UUID are sign-extended.
Additional InformationI bisected this to the following upstream commit:

  0478d9251abafd0876cdb3121ef2c07af6c99513 is the first bad commit
  commit 0478d9251abafd0876cdb3121ef2c07af6c99513
  Author: Christos Zoulas <christos@zoulas.com>
  Date: Sat Aug 22 18:27:42 2020 +0000

    Treat printf numbers as signed.

   src/softmagic.c | 28 ++++++++++++++--------------
   1 file changed, 14 insertions(+), 14 deletions(-)
TagsNo tags attached.

Activities

rwmjones

2021-03-31 11:57

reporter   ~0003580

The magic entry (magic/Magdir/filesystems) specifies %08x and %04x for the fields of the UUID. Normally %x would be unsigned (eg. the printf(3) man page documents this). So I think this is a regression in "file" itself, not a bug in the magic data.

christos

2021-04-19 19:04

manager   ~0003592

Thanks! The type and sign-ness of argument is determined by the magic type field and this has been fixed to be unsigned now.

Issue History

Date Modified Username Field Change
2021-03-31 11:46 rwmjones New Issue
2021-03-31 11:57 rwmjones Note Added: 0003580
2021-04-19 19:03 christos Assigned To => christos
2021-04-19 19:03 christos Status new => assigned
2021-04-19 19:04 christos Status assigned => resolved
2021-04-19 19:04 christos Resolution open => fixed
2021-04-19 19:04 christos Fixed in Version => 5.41
2021-04-19 19:04 christos Note Added: 0003592