Blob Blame History Raw
From 4d0b9163c9ef1f0cdbbf533317b291220c7fd1c7 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Jean-Pierre=20Andr=C3=A9?= <jpandre@users.sourceforge.net>
Date: Wed, 12 Sep 2012 09:42:24 +0200
Subject: [PATCH] Accepted processing restart pages v 2.0 with no warning (used by Windows 8)

In the $LogFile, Windows 8 defines restart pages with version 2.0.
The checks designed for version 1.1 appear to apply, so accept v 2.0
and apply the usual checks.
---
 libntfs-3g/logfile.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/libntfs-3g/logfile.c b/libntfs-3g/logfile.c
index a4f00d5..83811fa 100644
--- a/libntfs-3g/logfile.c
+++ b/libntfs-3g/logfile.c
@@ -84,13 +84,16 @@ static BOOL ntfs_check_restart_page_header(RESTART_PAGE_HEADER *rp, s64 pos)
 				"position in $LogFile.\n");
 		return FALSE;
 	}
-	/* We only know how to handle version 1.1. */
-	if (sle16_to_cpu(rp->major_ver) != 1 ||
-			sle16_to_cpu(rp->minor_ver) != 1) {
+	/* We only know how to handle version 1.1 and 2.0. */
+	if (((rp->major_ver != const_cpu_to_le16(1))
+			 || (rp->minor_ver != const_cpu_to_le16(1)))
+	   && ((rp->major_ver != const_cpu_to_le16(2))
+			 || (rp->minor_ver != const_cpu_to_le16(0)))) {
 		ntfs_log_error("$LogFile version %i.%i is not "
-				"supported.  (This driver supports version "
-				"1.1 only.)\n", (int)sle16_to_cpu(rp->major_ver),
-				(int)sle16_to_cpu(rp->minor_ver));
+				"supported.\n   (This driver supports version "
+				"1.1 and 2.0 only.)\n",
+					(int)sle16_to_cpu(rp->major_ver),
+					(int)sle16_to_cpu(rp->minor_ver));
 		return FALSE;
 	}
 	/*
-- 
1.7.4.1