From 6873bab2f1edd3af80adb60baf6efa35c91183d1 Mon Sep 17 00:00:00 2001 From: szaka Date: Wed, 5 Apr 2006 02:55:43 +0000 Subject: [PATCH] Compare the full attribute headers for non-resident attributes --- ntfsprogs/ntfscmp.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ntfsprogs/ntfscmp.c b/ntfsprogs/ntfscmp.c index e8c1c88a..ba1197c7 100644 --- a/ntfsprogs/ntfscmp.c +++ b/ntfsprogs/ntfscmp.c @@ -522,20 +522,17 @@ static void cmp_attribute_data(ntfs_attr *na1, ntfs_attr *na2) static int cmp_attribute_header(ATTR_RECORD *a1, ATTR_RECORD *a2) { - int header_size = offsetof(ATTR_RECORD, resident_end); + u32 header_size = offsetof(ATTR_RECORD, resident_end); if (a1->non_resident != a2->non_resident) return 1; if (a1->non_resident) { - - if (a1->compression_unit != a2->compression_unit) - return 1; - - header_size = offsetof(ATTR_RECORD, non_resident_end); - if (a1->compression_unit) - header_size = offsetof(ATTR_RECORD, compressed_end); - } + /* + * FIXME: includes paddings which are not handled by ntfsinfo! + */ + header_size = a1->length; + } return memcmp(a1, a2, header_size); }