From: Eric Biggers Date: Wed, 30 Jan 2013 02:17:13 +0000 (-0600) Subject: Update for ntfs-3g 2013.1.13 X-Git-Tag: v1.2.4~13 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=7f262affd75b6e6e3e2a449b1d956592c9772a96 Update for ntfs-3g 2013.1.13 --- diff --git a/configure.ac b/configure.ac index 2ed9d7da..bf1a6ff7 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) + 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 @@ -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`" + + 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 ]) else LIBNTFS_3G_LDADD= LIBNTFS_3G_CFLAGS= diff --git a/src/ntfs-capture.c b/src/ntfs-capture.c index 67efbc85..ad56ba75 100644 --- a/src/ntfs-capture.c +++ b/src/ntfs-capture.c @@ -678,7 +678,13 @@ int build_dentry_tree_ntfs(struct wim_dentry **root_p, 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); +#endif if (!vol) { ERROR_WITH_ERRNO("Failed to mount NTFS volume `%s' read-only", device); diff --git a/tests/test-imagex-ntfs b/tests/test-imagex-ntfs index 66c39de4..afe441fb 100755 --- a/tests/test-imagex-ntfs +++ b/tests/test-imagex-ntfs @@ -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 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' @@ -220,11 +223,14 @@ do_test 'echo 999 > file; 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} .' @@ -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; - 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;