blkid: Fix MD 0.90 superblock detection on little endian systems

MD 0.90 superblock format is host endian - need to check for bith big
endian and little endian magic.  Without this change MD components
created on little endian systems were not detected as such, which
could then lead to false positives when detecting filesystems.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
bitmap-optimize
Sergey Vlasov 2007-04-10 11:59:46 -04:00 committed by Theodore Ts'o
parent 62fc8cef45
commit 6b8be16e3a
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ static int check_mdraid(int fd, unsigned char *ret_uuid)
return -BLKID_ERR_IO;
/* Check for magic number */
if (memcmp("\251+N\374", buf, 4))
if (memcmp("\251+N\374", buf, 4) && memcmp("\374N+\251", buf, 4))
return -BLKID_ERR_PARAM;
if (!ret_uuid)