From 6b8be16e3ac9c5fc350ea25d864df7bb6e2f6f4c Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Tue, 10 Apr 2007 11:59:46 -0400 Subject: [PATCH] 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 Signed-off-by: Dmitry V. Levin --- lib/blkid/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index 24592bf3..b8a75de7 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -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) -- 2.11.0