]> wimlib.net Git - wimlib/commitdiff
Update for ntfs-3g 2013.1.13
authorEric Biggers <ebiggers3@gmail.com>
Wed, 30 Jan 2013 02:17:13 +0000 (20:17 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 30 Jan 2013 02:17:13 +0000 (20:17 -0600)
configure.ac
src/ntfs-capture.c
tests/test-imagex-ntfs

index 2ed9d7da89218a2d572b62badc16ed064e255fd0..bf1a6ff741416a078addf77d25d2f1d5386f6574 100644 (file)
@@ -185,6 +185,7 @@ if test "x$WITH_NTFS_3G" = "xyes"; then
        AC_DEFINE([WITH_NTFS_3G], [1], [Define to 1 to enable support for
                   NTFS-specific information])
 
        AC_DEFINE([WITH_NTFS_3G], [1], [Define to 1 to enable support for
                   NTFS-specific information])
 
+       dnl This effectively checks for NTFS-3g 2011.4.12 or later
        AC_CHECK_LIB([ntfs-3g], [ntfs_xattr_system_setxattr], [],
                        [AC_MSG_ERROR([Cannot find libntfs-3g version 2011-4-12
        or later. Without libntfs-3g, wimlib cannot include support for
        AC_CHECK_LIB([ntfs-3g], [ntfs_xattr_system_setxattr], [],
                        [AC_MSG_ERROR([Cannot find libntfs-3g version 2011-4-12
        or later. Without libntfs-3g, wimlib cannot include support for
@@ -195,6 +196,15 @@ if test "x$WITH_NTFS_3G" = "xyes"; then
        features.])])
        LIBNTFS_3G_LDADD="`pkg-config --libs libntfs-3g`"
        LIBNTFS_3G_CFLAGS="`pkg-config --cflags libntfs-3g`"
        features.])])
        LIBNTFS_3G_LDADD="`pkg-config --libs libntfs-3g`"
        LIBNTFS_3G_CFLAGS="`pkg-config --cflags libntfs-3g`"
+
+       dnl This checks for a NTFS-3g interface that was changed in the
+       dnl 2013.1.13 release
+       AC_CHECK_DECL([NTFS_MNT_RDONLY],
+                     [AC_DEFINE([HAVE_NTFS_MNT_RDONLY],
+                                [1],
+                                [Define to 1 if ntfs_mount() takes the flag NTFS_MNT_RDONLY])],
+                     ,
+                     [#include <ntfs-3g/volume.h>])
 else
        LIBNTFS_3G_LDADD=
        LIBNTFS_3G_CFLAGS=
 else
        LIBNTFS_3G_LDADD=
        LIBNTFS_3G_CFLAGS=
index 67efbc85b631708653ddf8ce88dcb3df5a370c96..ad56ba75b63afba455328676b8af21f53e495c58 100644 (file)
@@ -678,7 +678,13 @@ int build_dentry_tree_ntfs(struct wim_dentry **root_p,
 
        DEBUG("Mounting NTFS volume `%s' read-only", device);
 
 
        DEBUG("Mounting NTFS volume `%s' read-only", device);
 
+#ifdef HAVE_NTFS_MNT_RDONLY
+       /* NTFS-3g 2013 */
+       vol = ntfs_mount(device, NTFS_MNT_RDONLY);
+#else
+       /* NTFS-3g 2011, 2012 */
        vol = ntfs_mount(device, MS_RDONLY);
        vol = ntfs_mount(device, MS_RDONLY);
+#endif
        if (!vol) {
                ERROR_WITH_ERRNO("Failed to mount NTFS volume `%s' read-only",
                                 device);
        if (!vol) {
                ERROR_WITH_ERRNO("Failed to mount NTFS volume `%s' read-only",
                                 device);
index 66c39de4846bb8d90060eec53b112bbb38427e8b..afe441fb208d6d85a5dc7f48c443d6dd9a77e927 100755 (executable)
@@ -157,16 +157,19 @@ do_test "dd if=/dev/zero of=file bs=4096 count=10 &> /dev/null"
 msg "file with DOS name"
 do_test "echo 1 > file; setfattr -v file -n system.ntfs_dos_name file"
 
 msg "file with DOS name"
 do_test "echo 1 > file; setfattr -v file -n system.ntfs_dos_name file"
 
-msg "file with DOS name with alphabetically smaller hardlink in same directory"
-do_test "echo 1 > file; setfattr -v file -n system.ntfs_dos_name file; ln file aaa_link"
+# To be replaced/removed: files with DOS names can no longer be hard linked as
+# of NTFS-3g 2013.1.13.
 
 
-msg "file with DOS name with alphabetically larger hardlink in same directory"
-do_test "echo 1 > file; setfattr -v file -n system.ntfs_dos_name file; ln file zzz_link"
+#msg "file with DOS name with alphabetically smaller hardlink in same directory"
+#do_test "echo 1 > file; setfattr -v file -n system.ntfs_dos_name file; ln file aaa_link"
 
 
-msg "file with long name and with DOS name with alphabetically smaller hardlink in same directory"
-do_test 'echo 1 > file_with_a_long_name;
-        setfattr -v "file~1" -n system.ntfs_dos_name file_with_a_long_name;
-        ln file_with_a_long_name aaa_link'
+#msg "file with DOS name with alphabetically larger hardlink in same directory"
+#do_test "echo 1 > file; setfattr -v file -n system.ntfs_dos_name file; ln file zzz_link"
+
+#msg "file with long name and with DOS name with alphabetically smaller hardlink in same directory"
+#do_test 'echo 1 > file_with_a_long_name;
+        #setfattr -v "file~1" -n system.ntfs_dos_name file_with_a_long_name;
+        #ln file_with_a_long_name aaa_link'
 
 msg "many nested directories"
 do_test 'mkdir dir; mkdir dir/subdir; mkdir dir/subdir/subdir2; mkdir dir/subdir/subdir3'
 
 msg "many nested directories"
 do_test 'mkdir dir; mkdir dir/subdir; mkdir dir/subdir/subdir2; mkdir dir/subdir/subdir3'
@@ -220,11 +223,14 @@ do_test 'echo 999 > file;
         setfattr -n user.ads -v "888" file;
         ln file link;'
 
         setfattr -n user.ads -v "888" file;
         ln file link;'
 
-msg "file with named data stream with hardlink and DOS name"
-do_test 'echo 999 > file;
-        setfattr -n user.ads -v "888" file;
-        ln file link;
-        setfattr -v DOSNAME -n system.ntfs_dos_name file;'
+# To be replaced/removed: files with DOS names can no longer be hard linked as
+# of NTFS-3g 2013.1.13.
+
+#msg "file with named data stream with hardlink and DOS name"
+#do_test 'echo 999 > file;
+        #setfattr -n user.ads -v "888" file;
+        #ln file link;
+        #setfattr -v DOSNAME -n system.ntfs_dos_name file;'
 
 msg "C source code of wimlib"
 do_test 'cp $srcdir/src/*.{c,h} .'
 
 msg "C source code of wimlib"
 do_test 'cp $srcdir/src/*.{c,h} .'
@@ -274,7 +280,8 @@ do_test 'echo -n 8 > file;
         ln file dir/subdir/file;
         echo -n 8 > dir/subdir/file2;
         ln dir/subdir/file dir/subdir/link;
         ln file dir/subdir/file;
         echo -n 8 > dir/subdir/file2;
         ln dir/subdir/file dir/subdir/link;
-        setfattr -n system.ntfs_dos_name -v 123 dir/subdir/link;
+        echo -n > dir/subdir/empty;
+        setfattr -n system.ntfs_dos_name -v 123 dir/subdir/empty;
         setfattr -n system.ntfs_acl -v 0s`cat $srcdir/tests/security_descriptor_1.base64` dir/subdir/link;
         setfattr -n user.yet_another_ads -v "" dir/subdir/link;
         setfattr -n user.yet_another_ads2 -v "" dir/subdir/link;
         setfattr -n system.ntfs_acl -v 0s`cat $srcdir/tests/security_descriptor_1.base64` dir/subdir/link;
         setfattr -n user.yet_another_ads -v "" dir/subdir/link;
         setfattr -n user.yet_another_ads2 -v "" dir/subdir/link;