[SCM] Samba Shared Repository - branch v3-6-test updated

Karolin Seeger kseeger at samba.org
Tue Aug 20 02:45:19 MDT 2013


The branch, v3-6-test has been updated
       via  3dd2f64 Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed out by Samba.
      from  db77fc0 docs: Fix variable list in man vfs_crossrename.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 3dd2f645a054b47d709a6b6f6968f86b9e916d49
Author: Richard Sharpe <realrichardsharpe at gmail.com>
Date:   Mon Aug 19 13:14:55 2013 -0700

    Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed out by Samba.
    
    Windows overloads the EA Length field in the DIRECTORY INFO leves of FIND FIRST/FIND NEXT.
    
    This field indicates either the REPARSE_TAG if the file/folder has a reparse proint or
    the EA Length if it has EAs, and is the fundamental reason you cannot have both on a
    file or folder.
    
    Signed-off-by: Richard Sharpe <rsharpe at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/include/ntioctl.h |    1 +
 source3/smbd/dosmode.c    |    5 +++++
 source3/smbd/trans2.c     |   19 +++++++++++++------
 3 files changed, 19 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h
index 925a06f..c990ebc 100644
--- a/source3/include/ntioctl.h
+++ b/source3/include/ntioctl.h
@@ -122,6 +122,7 @@
 #define IO_REPARSE_TAG_MOUNT_POINT   0xA0000003
 #define IO_REPARSE_TAG_HSM           0xC0000004
 #define IO_REPARSE_TAG_SIS           0x80000007
+#define IO_REPARSE_TAG_DFS	     0x8000000A
 
 
 /* For FSCTL_GET_SHADOW_COPY_DATA ...*/
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 823d44d..326e995 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -484,6 +484,11 @@ uint32 dos_mode_msdfs(connection_struct *conn,
 
 	result = filter_mode_by_protocol(result);
 
+	/*
+	 * Add in that it is a reparse point
+	 */
+	result |= FILE_ATTRIBUTE_REPARSE_POINT;
+
 	DEBUG(8,("dos_mode_msdfs returning "));
 
 	if (result & FILE_ATTRIBUTE_HIDDEN) DEBUG(8, ("h"));
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 01b0130..ccce7b8 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -24,6 +24,7 @@
 */
 
 #include "includes.h"
+#include "ntioctl.h"
 #include "system/filesys.h"
 #include "version.h"
 #include "smbd/smbd.h"
@@ -1773,12 +1774,14 @@ static bool smbd_marshall_dir_entry(TALLOC_CTX *ctx,
 		SOFF_T(p,0,allocation_size); p += 8;
 		SIVAL(p,0,mode); p += 4;
 		q = p; p += 4; /* q is placeholder for name length. */
-		{
+		if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
+			SIVAL(p, 0, IO_REPARSE_TAG_DFS);
+		} else {
 			unsigned int ea_size = estimate_ea_size(conn, NULL,
 								smb_fname->base_name);
 			SIVAL(p,0,ea_size); /* Extended attributes */
-			p += 4;
 		}
+		p += 4;
 		/* Clear the short name buffer. This is
 		 * IMPORTANT as not doing so will trigger
 		 * a Win2k client bug. JRA.
@@ -1950,12 +1953,14 @@ static bool smbd_marshall_dir_entry(TALLOC_CTX *ctx,
 		SOFF_T(p,0,allocation_size); p += 8;
 		SIVAL(p,0,mode); p += 4;
 		q = p; p += 4; /* q is placeholder for name length. */
-		{
+		if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
+			SIVAL(p, 0, IO_REPARSE_TAG_DFS);
+		} else {
 			unsigned int ea_size = estimate_ea_size(conn, NULL,
 								smb_fname->base_name);
 			SIVAL(p,0,ea_size); /* Extended attributes */
-			p +=4;
 		}
+		p +=4;
 		SIVAL(p,0,0); p += 4; /* Unknown - reserved ? */
 		SBVAL(p,0,file_index); p += 8;
 		len = srvstr_push(base_data, flags2, p,
@@ -1996,12 +2001,14 @@ static bool smbd_marshall_dir_entry(TALLOC_CTX *ctx,
 		SOFF_T(p,0,allocation_size); p += 8;
 		SIVAL(p,0,mode); p += 4;
 		q = p; p += 4; /* q is placeholder for name length */
-		{
+		if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
+			SIVAL(p, 0, IO_REPARSE_TAG_DFS);
+		} else {
 			unsigned int ea_size = estimate_ea_size(conn, NULL,
 								smb_fname->base_name);
 			SIVAL(p,0,ea_size); /* Extended attributes */
-			p +=4;
 		}
+		p +=4;
 		/* Clear the short name buffer. This is
 		 * IMPORTANT as not doing so will trigger
 		 * a Win2k client bug. JRA.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list