Bug 1945122 - Printing ext4 filesystem UUIDs is broken with file 5.40
Summary: Printing ext4 filesystem UUIDs is broken with file 5.40
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: file
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vincent Mihalkovič
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
 
Reported: 2021-03-31 11:42 UTC by Richard W.M. Jones
Modified: 2021-04-26 18:08 UTC (History)
5 users (show)

Fixed In Version: file-5.40-5.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-26 18:08:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2021-03-31 11:42:19 UTC
Description of problem:

file 5.40 can no longer print ext4 filesystem UUIDs correctly.

Version-Release number of selected component (if applicable):

  file-5.40-1.fc35.x86_64

How reproducible:

  100%

Steps to Reproduce:

1. 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.

I cannot register with the upstream tracker at the moment, but
I did bisect this to the following upstream commit:

  0478d9251abafd0876cdb3121ef2c07af6c99513 is the first bad commit
  commit 0478d9251abafd0876cdb3121ef2c07af6c99513
  Author: Christos Zoulas <christos>
  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(-)

Comment 1 Richard W.M. Jones 2021-03-31 11:47:04 UTC
Upstream bug report:
https://bugs.astron.com/view.php?id=253

Comment 2 Vincent Mihalkovič 2021-04-26 18:08:17 UTC
Thank you, Richard!

dist-git commit: https://src.fedoraproject.org/rpms/file/c/15baab7f108ac146e8af7d358ab590e3782b6fa8


Note You need to log in before you can comment on or make changes to this bug.