NTFS volume label not found due to endian conversion bug in libblkid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been having a problem with blkid not finding the volume label on NTFS volumes on my big-endian (PowerPC) system. I tracked the issue down to a bug in the endian conversion code for parsing the MFT $Volume attributes in ntfs.c.

On line 133 of shlibs/blkid/src/superblocks/ntfs.c

                attr_len = le16_to_cpu(attr->len);

Should be:

                attr_len = le32_to_cpu(attr->len);

because attr->len is a uint32_t .

blkid output before fix:
blkid /dev/sda1
/dev/sda1: UUID="XXX04082A0407XXX" TYPE="ntfs" 

blkid output after fix:
blkid /dev/sda1
/dev/sda1: UUID="XXX04082A0407XXX" TYPE="ntfs" LABEL="Backup" 

This probably wasn't found earlier because the incorrect code works fine on little-endian systems.

Thanks,
Hugh Eaves--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux