Your message dated Wed, 22 Aug 2012 05:17:44 +0000
with message-id <e1t43k4-0004xq...@franck.debian.org>
and subject line Bug#685551: fixed in ntfs-3g 1:2012.1.15AR.6-1
has caused the Debian Bug report #685551,
regarding ntfs-3g: returns incorect type for junction points in readdir()
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
685551: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685551
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: ntfs-3g
Version: 1:2012.1.15AR.5-4
Severity: serious
Tags: patch upstream
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu quantal ubuntu-patch

*** /tmp/tmpkpCNMv/bug_body

In Ubuntu, the attached patch was applied to achieve the following:

  * ntfs-3g-junction-point-fix.patch: Return the correct type (DT_LINK) for
    NTFS Junction points, in readdir(). (LP: #997391)

A bug was recently fixed in upstream ntfs-3g, where baobab (The GNOME
disk usage visualisation tool) will loop infinitely when scanning a
Windows 7 partition.

http://tuxera.com/forum/viewtopic.php?f=2&t=29578
https://bugzilla.redhat.com/show_bug.cgi?id=849332

Thanks for considering the patch.

SR

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing-proposed-updates
  APT policy: (500, 'testing-proposed-updates'), (500, 'unstable'), (500, 
'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_ZA.UTF-8, LC_CTYPE=en_ZA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Description: Return d_type = DT_LNK for NTFS Junction points in readdir()
 readdir() was returning DT_DIR while stat() was returning S_IFLNK.
 This caused baobab to infinitely loop.
Author: Jean-Pierre Andre
Origin: upstream, http://tuxera.com/forum/viewtopic.php?f=2&t=29578
Bug-Ubuntu: https://launchpad.net/bugs/997391
Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=849332
Last-Update: 2012-08-21

--- a/libntfs-3g/dir.c
+++ b/libntfs-3g/dir.c
@@ -867,6 +867,83 @@
 	INDEX_TYPE_ALLOCATION,	/* index allocation */
 } INDEX_TYPE;
 
+/*
+ *		Decode Interix file types
+ *
+ *	Non-Interix types are returned as plain files, because a
+ *	Windows user may force patterns very similar to Interix.
+ */
+
+static u32 ntfs_interix_types(ntfs_inode *ni)
+{
+	ntfs_attr *na;
+	u32 dt_type;
+	le64 magic;
+
+	dt_type = NTFS_DT_UNKNOWN;
+	na = ntfs_attr_open(ni, AT_DATA, NULL, 0);
+	if (na) {
+		/* Unrecognized patterns (eg HID + SYST) are plain files */
+		dt_type = NTFS_DT_REG;
+		if (na->data_size <= 1) {
+			if (!(ni->flags & FILE_ATTR_HIDDEN))
+				dt_type = (na->data_size ?
+						NTFS_DT_SOCK : NTFS_DT_FIFO);
+		} else {
+			if ((na->data_size >= (s64)sizeof(magic))
+			    && (ntfs_attr_pread(na, 0, sizeof(magic), &magic)
+				== sizeof(magic))) {
+				if (magic == INTX_SYMBOLIC_LINK)
+					dt_type = NTFS_DT_LNK;
+				else if (magic == INTX_BLOCK_DEVICE)
+					dt_type = NTFS_DT_BLK;
+				else if (magic == INTX_CHARACTER_DEVICE)
+					dt_type = NTFS_DT_CHR;
+			}
+		}
+		ntfs_attr_close(na);
+	}
+	return (dt_type);
+}
+
+/*
+ *		Decode file types
+ *
+ *	Better only use for Interix types and junctions,
+ *	unneeded complexity when used for plain files or directories
+ *
+ *	Error cases are logged and returned as unknown.
+ */
+
+static u32 ntfs_dir_entry_type(ntfs_inode *dir_ni, MFT_REF mref, FILE_ATTR_FLAGS attributes)
+{
+	ntfs_inode *ni;
+	u32 dt_type;
+
+	dt_type = NTFS_DT_UNKNOWN;
+	ni = ntfs_inode_open(dir_ni->vol, mref);
+	if (ni) {
+		if ((attributes & FILE_ATTR_REPARSE_POINT)
+		    && ntfs_possible_symlink(ni))
+			dt_type = NTFS_DT_LNK;
+		else
+			if ((attributes & FILE_ATTR_SYSTEM)
+			   && !(attributes & FILE_ATTR_I30_INDEX_PRESENT))
+				dt_type = ntfs_interix_types(ni);
+			else
+				dt_type = (attributes
+						& FILE_ATTR_I30_INDEX_PRESENT
+					? NTFS_DT_DIR : NTFS_DT_REG);
+		if (ntfs_inode_close(ni)) {
+				 /* anything special to do ? */
+		}
+	}
+	if (dt_type == NTFS_DT_UNKNOWN)
+		ntfs_log_error("Could not decode the type of inode %lld\n",
+				(long long)MREF(mref));
+	return (dt_type);
+}
+
 /**
  * ntfs_filldir - ntfs specific filldir method
  * @dir_ni:	ntfs inode of current directory
@@ -901,19 +978,23 @@
 				dir_ni->vol->mft_record_size;
 	else /* if (index_type == INDEX_TYPE_ROOT) */
 		*pos = (u8*)ie - (u8*)iu.ir;
+	mref = le64_to_cpu(ie->indexed_file);
+        metadata = (MREF(mref) != FILE_root) && (MREF(mref) < FILE_first_user);
 	/* Skip root directory self reference entry. */
 	if (MREF_LE(ie->indexed_file) == FILE_root)
 		return 0;
-	if (ie->key.file_name.file_attributes & FILE_ATTR_I30_INDEX_PRESENT)
+	if ((ie->key.file_name.file_attributes
+		     & (FILE_ATTR_REPARSE_POINT | FILE_ATTR_SYSTEM))
+	    && !metadata)
+		dt_type = ntfs_dir_entry_type(dir_ni, mref,
+					ie->key.file_name.file_attributes);
+	else if (ie->key.file_name.file_attributes
+		     & FILE_ATTR_I30_INDEX_PRESENT)
 		dt_type = NTFS_DT_DIR;
-	else if (fn->file_attributes & FILE_ATTR_SYSTEM)
-		dt_type = NTFS_DT_UNKNOWN;
 	else
 		dt_type = NTFS_DT_REG;
 
 		/* return metadata files and hidden files if requested */
-	mref = le64_to_cpu(ie->indexed_file);
-        metadata = (MREF(mref) != FILE_root) && (MREF(mref) < FILE_first_user);
         if ((!metadata && (NVolShowHidFiles(dir_ni->vol)
 				|| !(fn->file_attributes & FILE_ATTR_HIDDEN)))
             || (NVolShowSysFiles(dir_ni->vol) && (NVolShowHidFiles(dir_ni->vol)
--- a/src/ntfs-3g.c
+++ b/src/ntfs-3g.c
@@ -1017,10 +1017,30 @@
 	} else {
 		struct stat st = { .st_ino = MREF(mref) };
 		 
-		if (dt_type == NTFS_DT_REG)
-			st.st_mode = S_IFREG | (0777 & ~ctx->fmask);
-		else if (dt_type == NTFS_DT_DIR)
+		switch (dt_type) {
+		case NTFS_DT_DIR :
 			st.st_mode = S_IFDIR | (0777 & ~ctx->dmask); 
+			break;
+		case NTFS_DT_LNK :
+			st.st_mode = S_IFLNK | 0777;
+			break;
+		case NTFS_DT_FIFO :
+			st.st_mode = S_IFIFO;
+			break;
+		case NTFS_DT_SOCK :
+			st.st_mode = S_IFSOCK;
+			break;
+		case NTFS_DT_BLK :
+			st.st_mode = S_IFBLK;
+			break;
+		case NTFS_DT_CHR :
+			st.st_mode = S_IFCHR;
+			break;
+		default : /* unexpected types shown as plain files */
+		case NTFS_DT_REG :
+			st.st_mode = S_IFREG | (0777 & ~ctx->fmask);
+			break;
+		}
 		
 #if defined(__APPLE__) || defined(__DARWIN__)
 		/* 
--- a/src/lowntfs-3g.c
+++ b/src/lowntfs-3g.c
@@ -920,10 +920,30 @@
 	if (MREF(mref) > 1) {
 		struct stat st = { .st_ino = MREF(mref) };
 		 
-		if (dt_type == NTFS_DT_REG)
-			st.st_mode = S_IFREG | (0777 & ~ctx->fmask);
-		else if (dt_type == NTFS_DT_DIR)
+		switch (dt_type) {
+		case NTFS_DT_DIR :
 			st.st_mode = S_IFDIR | (0777 & ~ctx->dmask); 
+			break;
+		case NTFS_DT_LNK :
+			st.st_mode = S_IFLNK | 0777;
+			break;
+		case NTFS_DT_FIFO :
+			st.st_mode = S_IFIFO;
+			break;
+		case NTFS_DT_SOCK :
+			st.st_mode = S_IFSOCK;
+			break;
+		case NTFS_DT_BLK :
+			st.st_mode = S_IFBLK;
+			break;
+		case NTFS_DT_CHR :
+			st.st_mode = S_IFCHR;
+			break;
+		default : /* unexpected types shown as plain files */
+		case NTFS_DT_REG :
+			st.st_mode = S_IFREG | (0777 & ~ctx->fmask);
+			break;
+		}
 	        
 #if defined(__APPLE__) || defined(__DARWIN__)
 		/* 

--- End Message ---
--- Begin Message ---
Source: ntfs-3g
Source-Version: 1:2012.1.15AR.6-1

We believe that the bug you reported is fixed in the latest version of
ntfs-3g, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 685...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <daniel.baum...@progress-technologies.net> (supplier of updated 
ntfs-3g package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 22 Aug 2012 06:44:36 +0200
Source: ntfs-3g
Binary: ntfs-3g ntfs-3g-dbg ntfs-3g-dev ntfs-3g-udeb ntfsprogs
Architecture: source i386 all
Version: 1:2012.1.15AR.6-1
Distribution: unstable
Urgency: low
Maintainer: Daniel Baumann <daniel.baum...@progress-technologies.net>
Changed-By: Daniel Baumann <daniel.baum...@progress-technologies.net>
Description: 
 ntfs-3g    - read/write NTFS driver for FUSE
 ntfs-3g-dbg - read/write NTFS driver for FUSE (debug)
 ntfs-3g-dev - read/write NTFS driver for FUSE (development)
 ntfs-3g-udeb - read/write NTFS driver for FUSE (udeb)
 ntfsprogs  - read/write NTFS driver for FUSE (transitional package)
Closes: 685551
Changes: 
 ntfs-3g (1:2012.1.15AR.6-1) unstable; urgency=low
 .
   * Merging upstream version 2012.1.15AR.6.
   * Updating local upstream changelog.
   * Adding patch from upstream to fix the readdir syscall to set the
     d_type to 10 (Symbolic link) whenever a junction point is detected,
     avoids loops on windows 7 NTFS (Closes: #685551).
   * Protecting multiarch queries since install files are run with set -
     e.
Checksums-Sha1: 
 70c5d5770e3f2b1e4db5c652b306ff62468bcbac 1467 ntfs-3g_2012.1.15AR.6-1.dsc
 197803a41f38645e486e83acb5b1358ed0259224 785240 
ntfs-3g_2012.1.15AR.6.orig.tar.xz
 3a6741ece40efccda1d7d2c7b285c4bc79145f42 26932 
ntfs-3g_2012.1.15AR.6-1.debian.tar.xz
 bcc67cacc6eaa90840dfcf20ca34b9bc285405a2 461668 
ntfs-3g_2012.1.15AR.6-1_i386.deb
 2ef3125cc4cd4ac642a9c8bc44c68954fc7a6fda 1296972 
ntfs-3g-dbg_2012.1.15AR.6-1_i386.deb
 ab07e5f506ae6b2f472a2a7c05802d33053e1091 217010 
ntfs-3g-dev_2012.1.15AR.6-1_i386.deb
 b20e803b40047809c215a543d2086f5d00f7781f 198966 
ntfs-3g-udeb_2012.1.15AR.6-1_i386.udeb
 364d581ced40389d3aed57ceda0560fd0318ff83 18158 
ntfsprogs_2012.1.15AR.6-1_all.deb
Checksums-Sha256: 
 33ccce35c1c8b00c198df9de8fef48e5e3ad80c785c14bab1e173c2e517d9d2b 1467 
ntfs-3g_2012.1.15AR.6-1.dsc
 da5e595b559e0c569c37f5495f42a8f55ebb9bd57483ef15b9c92009f415a4b9 785240 
ntfs-3g_2012.1.15AR.6.orig.tar.xz
 7d17a1570a53bf9458301dd082152a71171d99d859da36e9a97c854baf96daff 26932 
ntfs-3g_2012.1.15AR.6-1.debian.tar.xz
 552aee00e5508c671a05952ac631ca6d395a64033a5c81b840ed5ffaceffa9e0 461668 
ntfs-3g_2012.1.15AR.6-1_i386.deb
 fef19c0832b882865c3ecfeafc5af60c0fd8d545d41640b51bd1b3a3e88bd802 1296972 
ntfs-3g-dbg_2012.1.15AR.6-1_i386.deb
 bf7e0bcd0839db8841d09ce4f8e9e31de719ba36dcaf096f0e844eb90f00eb2a 217010 
ntfs-3g-dev_2012.1.15AR.6-1_i386.deb
 5ebd969d67238b2a71dab8fadb29375f02c2110ad098268ccf83a088109bba45 198966 
ntfs-3g-udeb_2012.1.15AR.6-1_i386.udeb
 de10a97b4dc0cfd1a77c7f19b46b479af0ef4472530e86b78d24c808f9bad9eb 18158 
ntfsprogs_2012.1.15AR.6-1_all.deb
Files: 
 8f72aca2cd83dd4fba486eb35cfe109e 1467 otherosfs optional 
ntfs-3g_2012.1.15AR.6-1.dsc
 df9bb6ac3c7a30b65210a0acb97324ea 785240 otherosfs optional 
ntfs-3g_2012.1.15AR.6.orig.tar.xz
 c3644f3980c51b01ee9bbe7017427cbc 26932 otherosfs optional 
ntfs-3g_2012.1.15AR.6-1.debian.tar.xz
 eed4c60e5fea2d62301cb3d3e51f3e65 461668 otherosfs optional 
ntfs-3g_2012.1.15AR.6-1_i386.deb
 4449bc583f1963fa00b002ea8c4a75eb 1296972 debug extra 
ntfs-3g-dbg_2012.1.15AR.6-1_i386.deb
 a10bb8da6600ac94d035f2c8a4be035c 217010 libdevel optional 
ntfs-3g-dev_2012.1.15AR.6-1_i386.deb
 da0b5af597e830e3d19be980268d64bb 198966 debian-installer optional 
ntfs-3g-udeb_2012.1.15AR.6-1_i386.udeb
 a48bd4914aaaa09615f09f366c966fba 18158 oldlibs extra 
ntfsprogs_2012.1.15AR.6-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAlA0adsACgkQ+C5cwEsrK57XQgCgx9hNqJqdYt2w/Tamxegwdo0d
sjUAoMCefGd9GC1gbhAHSt1pIfKJMn4m
=FMpF
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to