[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Jan 24 13:02:02 MST 2013


The branch, master has been updated
       via  996a10c Fix bug #9572 - File corruption during SMB1 read by Mac OSX 10.8.2 clients.
       via  0331979 Revert "s3:smbd: SMB ReadX with size > 0xffff should only possible for samba clients."
      from  000e6ba s4-torture: add some basic tests for PlayGDIScriptOnPrinterIC.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 996a10cdea4a1ea23bc86c8bc57c4ca02e285b17
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jan 23 09:57:50 2013 -0800

    Fix bug #9572 - File corruption during SMB1 read by Mac OSX 10.8.2 clients.
    
    Accept a large read if we told the client we have UNIX extensions
    and the client sent a non-zero upper 16-bit size.
    
    Do the non-zero upper 16-bit size check first to save a function
    call in what is a hot path.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jan 24 21:01:51 CET 2013 on sn-devel-104

commit 033197958ec97140d5632ab875f24350257963dd
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 22 12:38:28 2013 -0800

    Revert "s3:smbd: SMB ReadX with size > 0xffff should only possible for samba clients."
    
    Part of fix for bug #9572 -  File corruption during SMB1 read by Mac OSX 10.8.2 clients
    
    This reverts commit f8c26c16b82989e002b839fc9eba6386fc036f6a.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 source3/smbd/reply.c |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b511025..6e1cd27 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -3849,16 +3849,36 @@ nosendfile_read:
 }
 
 /****************************************************************************
+ MacOSX clients send large reads without telling us they are going to do that.
+ Bug #9572 - File corruption during SMB1 read by Mac OSX 10.8.2 clients
+ Allow this if we are talking to a Samba client, or if we told the client
+ we supported this.
+****************************************************************************/
+
+static bool server_will_accept_large_read(void)
+{
+	/* Samba client ? No problem. */
+	if (get_remote_arch() == RA_SAMBA) {
+		return true;
+	}
+	/* Need UNIX extensions. */
+	if (!lp_unix_extensions()) {
+		return false;
+	}
+	return true;
+}
+
+/****************************************************************************
  Reply to a read and X.
 ****************************************************************************/
 
 void reply_read_and_X(struct smb_request *req)
 {
-	struct smbd_server_connection *sconn = req->sconn;
 	connection_struct *conn = req->conn;
 	files_struct *fsp;
 	off_t startpos;
 	size_t smb_maxcnt;
+	size_t upper_size;
 	bool big_readX = False;
 #if 0
 	size_t smb_mincnt = SVAL(req->vwv+6, 0);
@@ -3893,8 +3913,8 @@ void reply_read_and_X(struct smb_request *req)
 		return;
 	}
 
-	if ((sconn->smb1.unix_info.client_cap_low & CIFS_UNIX_LARGE_READ_CAP) ||
-	    (get_remote_arch() == RA_SAMBA)) {
+	upper_size = SVAL(req->vwv+7, 0);
+	if ((upper_size != 0) && server_will_accept_large_read()) {
 		/*
 		 * This is Samba only behavior (up to Samba 3.6)!
 		 *
@@ -3902,7 +3922,6 @@ void reply_read_and_X(struct smb_request *req)
 		 * so we do unless unix extentions are active
 		 * or "smbclient" is talking to us.
 		 */
-		size_t upper_size = SVAL(req->vwv+7, 0);
 		smb_maxcnt |= (upper_size<<16);
 		if (upper_size > 1) {
 			/* Can't do this on a chained packet. */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list