From 4e1693d0ef3149ffa603e2089a4fd270e7687c4d Mon Sep 17 00:00:00 2001 From: szaka Date: Tue, 20 Feb 2007 19:09:32 +0000 Subject: [PATCH] Don't calculate bootsector checksum, ntfs doesn't use it and it's often off --- libntfs-3g/bootsect.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/libntfs-3g/bootsect.c b/libntfs-3g/bootsect.c index f4d406c4..f13a11cd 100644 --- a/libntfs-3g/bootsect.c +++ b/libntfs-3g/bootsect.c @@ -64,25 +64,6 @@ BOOL ntfs_boot_sector_is_ntfs(NTFS_BOOT_SECTOR *b) ntfs_log_debug("Beginning bootsector check.\n"); - /* Calculate the checksum. Note, this is just a simple addition of - all u32 values in the bootsector starting at the beginning and - finishing at the offset of the checksum itself (i.e. not including - the checksum...). */ - if ((void*)b < (void*)&b->checksum) { - u32 *u = (u32 *)b; - u32 *bi = (u32 *)(&b->checksum); - - ntfs_log_debug("Calculating bootsector checksum.\n"); - - for (i = 0; u < bi; ++u) - i += le32_to_cpup(u); - - if (le32_to_cpu(b->checksum) && le32_to_cpu(b->checksum) != i) { - ntfs_log_error("Bootsector checksum failed.\n"); - goto not_ntfs; - } - } - ntfs_log_debug("Checking OEMid, NTFS signature.\n"); if (b->oem_id != cpu_to_le64(0x202020205346544eULL)) { /* "NTFS " */ ntfs_log_error("NTFS signature is missing.\n");