Bug#515019: Leading zeroes may cause bogus UUID display for ext2/3 filesystems and swap space

2009-03-21 Thread Daniel Baumann
tags 515019 +pending
thanks

applied in git, thanks.

-- 
Address:Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email:  daniel.baum...@panthera-systems.net
Internet:   http://people.panthera-systems.net/~daniel-baumann/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#515019: Leading zeroes may cause bogus UUID display for ext2/3 filesystems and swap space

2009-02-12 Thread Bjørn Mork
Package: file
Version: 4.26-1
Severity: normal
Tags: patch

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

file will strip leading zeroes when displaying UUIDs.  Compare the output of
these commands on the same file system:

nemi:/etc# tune2fs -l /dev/sda1|grep UUID
Filesystem UUID:  0b7e7b52-e5cd-49b8-a304-2bc5f9b7f2b5
nemi:/etc# file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext2 filesystem data (mounted or unclean), 
UUID=b7e7b52-e5cd-49b8-a304-2bc5f9b7f2b5


The UUID reported by file will cause mounting problems if copied to
/etc/fstab.

The fix is simple.  I'm attaching a patch against /usr/share/misc/magic


Bjorn

- -- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (700, 'testing'), (600, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-rc3-lenovo-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages file depends on:
ii  libc6  2.7-18GNU C Library: Shared libraries
ii  libmagic1  4.26-1File type determination library us
ii  zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime

file recommends no packages.

file suggests no packages.

- -- no debconf information

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmUguoACgkQ10rqkowbIskuMgCcC74eilUUpJoZPLt1sHU8ItuW
IAIAoIp9JCYer8njG44lLkWFACKzjaer
=9lvp
-END PGP SIGNATURE-
--- a/magic 2008-09-08 14:38:38.0 +0200
+++ b/magic 2009-02-12 21:01:24.519745827 +0100
@@ -6003,12 +6003,12 @@
 >>>0x464 lelong >0x007  ext4 filesystem data
 #  else large INCOMPAT?
 >>0x460lelong  >0x03f  ext4 filesystem data
->0x468 belong  x   \b, UUID=%x
->0x46c beshort x   \b-%x
->0x46e beshort x   \b-%x
->0x470 beshort x   \b-%x
->0x472 belong  x   \b-%x
->0x476 beshort x   \b%x
+>0x468 belong  x   \b, UUID=%08x
+>0x46c beshort x   \b-%04x
+>0x46e beshort x   \b-%04x
+>0x470 beshort x   \b-%04x
+>0x472 belong  x   \b-%08x
+>0x476 beshort x   \b%04x
 >0x478 string  >0  \b, volume name "%s"
 # General flags for any ext* fs
 >0x460 lelong  &0x004  (needs journal recovery)
@@ -8771,12 +8771,12 @@
 >0x404 longx   size %d pages,
 >1052  string  \0  no label,
 >1052  string  >\0 LABEL=%s,
->0x40c belong  x   UUID=%x
->0x410 beshort x   \b-%x
->0x412 beshort x   \b-%x
->0x414 beshort x   \b-%x
->0x416 belong  x   \b-%x
->0x41a beshort x   \b%x
+>0x40c belong  x   UUID=%08x
+>0x410 beshort x   \b-%04x
+>0x412 beshort x   \b-%04x
+>0x414 beshort x   \b-%04x
+>0x416 belong  x   \b-%08x
+>0x41a beshort x   \b%04x
 # ECOFF magic for OSF/1 and Linux (only tested under Linux though)
 #
 #  from Erik Troan (e...@redhat.com) examining od dumps, so this