Hello community,

here is the log from the commit of package ntfs-3g_ntfsprogs for 
openSUSE:Factory checked in at 2013-02-01 09:48:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ntfs-3g_ntfsprogs (Old)
 and      /work/SRC/openSUSE:Factory/.ntfs-3g_ntfsprogs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ntfs-3g_ntfsprogs", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/ntfs-3g_ntfsprogs/ntfs-3g_ntfsprogs.changes      
2012-11-28 11:14:56.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ntfs-3g_ntfsprogs.new/ntfs-3g_ntfsprogs.changes 
2013-02-01 09:48:26.000000000 +0100
@@ -1,0 +2,8 @@
+Thu Jan 31 21:04:14 UTC 2013 - badshah...@gmail.com
+
+- Add ntfs-3g_ntfsprogs-use-caution-with-fastboot.patch to 
+  prevent partitions with metadata cached in Windows (when
+  FastBoot is enabled) from being mounted; patch taken from
+  upstream git and rebased (bnc#798337 / rh#859373).
+
+-------------------------------------------------------------------

New:
----
  ntfs-3g_ntfsprogs-use-caution-with-fastboot.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ntfs-3g_ntfsprogs.spec ++++++
--- /var/tmp/diff_new_pack.2Imuqr/_old  2013-02-01 09:48:27.000000000 +0100
+++ /var/tmp/diff_new_pack.2Imuqr/_new  2013-02-01 09:48:27.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ntfs-3g_ntfsprogs
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@
 Source:         %{name}-%{version}.tar.bz2
 Source1:        buildall.sh
 Source2:        21-storage-ntfs-3g.fdi
+# PATCH-FIX-UPSTREAM ntfs-3g_ntfsprogs-use-caution-with-fastboot.patch 
rh#859373 badshah...@gmail.com -- Prevent partitions with metadata cached in 
Windows from being mounted; patch taken from upstream git
+Patch0:         ntfs-3g_ntfsprogs-use-caution-with-fastboot.patch
 Url:            http://ntfs-3g.org/
 %if 0%{?sles_version}
 BuildRequires:  fuse-devel >= 2.6.0
@@ -97,6 +99,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 #


++++++ ntfs-3g_ntfsprogs-use-caution-with-fastboot.patch ++++++
>From 4d0b9163c9ef1f0cdbbf533317b291220c7fd1c7 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Jean-Pierre=20Andr=C3=A9?= <jpan...@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(-)

Index: ntfs-3g_ntfsprogs-2012.1.15/libntfs-3g/logfile.c
===================================================================
--- ntfs-3g_ntfsprogs-2012.1.15.orig/libntfs-3g/logfile.c
+++ ntfs-3g_ntfsprogs-2012.1.15/libntfs-3g/logfile.c
@@ -84,13 +84,21 @@ static BOOL ntfs_check_restart_page_head
                                "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, though
+        * version 2.0 is probably related to cached metadata in
+        * Windows 8, and we will refuse to mount.
+        * Nevertheless, do all the relevant checks before rejecting.
+        */
+       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;
        }
        /*
Index: ntfs-3g_ntfsprogs-2012.1.15/libntfs-3g/volume.c
===================================================================
--- ntfs-3g_ntfsprogs-2012.1.15.orig/libntfs-3g/volume.c
+++ ntfs-3g_ntfsprogs-2012.1.15/libntfs-3g/volume.c
@@ -89,13 +89,9 @@ static const char *corrupt_volume_msg =
 "for more details.\n";
 
 static const char *hibernated_volume_msg =
-"The NTFS partition is hibernated. Please resume and shutdown Windows\n"
-"properly, or mount the volume read-only with the 'ro' mount option, or\n"
-"mount the volume read-write with the 'remove_hiberfile' mount option.\n"
-"For example type on the command line:\n"
-"\n"
-"            mount -t ntfs-3g -o remove_hiberfile %s %s\n"
-"\n";
+"The NTFS partition is in an unsafe state. Please resume and shutdown\n"
+"Windows fully (no hibernation or fast restarting), or mount the volume\n"
+"read-only with the 'ro' mount option.\n";
 
 static const char *unclean_journal_msg =
 "Write access is denied because the disk wasn't safely powered\n"
@@ -649,6 +645,24 @@ static int ntfs_volume_check_logfile(ntf
        
        if (!ntfs_check_logfile(na, &rp) || !ntfs_is_logfile_clean(na, rp))
                err = EOPNOTSUPP;
+               /*
+                * If the latest restart page was identified as version
+                * 2.0, then Windows may have kept a cached copy of
+                * metadata for fast restarting, and we should not mount.
+                * Hibernation will be seen the same way on a non
+                * Windows-system partition, so we have to use the same
+                * error code (EPERM).
+                * The restart page may also be identified as version 2.0
+                * when access to the file system is terminated abruptly
+                * by unplugging or power cut, so mounting is also rejected
+                * after such an event.
+                */
+       if (rp
+           && (rp->major_ver == const_cpu_to_le16(2))
+           && (rp->minor_ver == const_cpu_to_le16(0))) {
+               ntfs_log_error("Metadata kept in Windows cache, refused to 
mount.\n");
+               err = EPERM;
+       }
        free(rp);
        ntfs_attr_close(na);
 out:   
@@ -1200,7 +1214,8 @@ ntfs_volume *ntfs_device_mount(struct nt
                    ntfs_volume_check_hiberfile(vol, 1) < 0)
                        goto error_exit;
                if (ntfs_volume_check_logfile(vol) < 0) {
-                       if (!(flags & MS_RECOVER))
+                       /* Always reject cached metadata for now */
+                       if (!(flags & MS_RECOVER) || (errno == EPERM))
                                goto error_exit;
                        ntfs_log_info("The file system wasn't safely "
                                      "closed on Windows. Fixing.\n");
@@ -1642,6 +1657,10 @@ int ntfs_volume_error(int err)
                        ret = NTFS_VOLUME_CORRUPT;
                        break;
                case EPERM:
+                       /*
+                        * Hibernation and fast restarting are seen the
+                        * same way on a non Windows-system partition.
+                        */
                        ret = NTFS_VOLUME_HIBERNATED;
                        break;
                case EOPNOTSUPP:
Index: ntfs-3g_ntfsprogs-2012.1.15/src/ntfs-3g.8.in
===================================================================
--- ntfs-3g_ntfsprogs-2012.1.15.orig/src/ntfs-3g.8.in
+++ ntfs-3g_ntfsprogs-2012.1.15/src/ntfs-3g.8.in
@@ -36,6 +36,22 @@ a few differences mentioned below in rel
 .PP
 The \fIvolume\fR to be mounted can be either a block device or 
 an image file.
+.SS Windows hibernation and fast restarting
+On computers which can be dual-booted into Windows or Linux, Windows has
+to be fully shut down before booting into Linux, otherwise the NTFS file
+systems on internal disks may be left in an inconsistent state and changes
+made by Linux may be ignored by Windows.
+.P
+So, Windows may not be left in hibernation when starting Linux, in order
+to avoid inconsistencies. Moreover, the fast restart feature available on
+recent Windows systems has to be disabled. This can be achieved by issuing
+as an Administrator the Windows command which disables both
+hibernation and fast restarting :
+.RS
+.sp
+powercfg /h off
+.sp
+.RE
 .SS Access Handling and Security
 By default, files and directories are owned by the effective 
 user and group of the mounting process, and everybody has
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to