[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Tue Oct 6 22:55:04 UTC 2015


The branch, master has been updated
       via  1bb46da s3:smb3: rename smbd_smb2_first_negprot and pass expected seq_low
       via  c0aa94e s3:smbd: add expected_seq_low arg to smbd_initialize_smb2
      from  8de1ed6 s4: fix linking smbtorture on Solaris.

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


- Log -----------------------------------------------------------------
commit 1bb46dae829d9cd74534669371246ada86b5841a
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Sep 27 02:01:47 2015 +0200

    s3:smb3: rename smbd_smb2_first_negprot and pass expected seq_low
    
    This is in preperation of connection passing where we have to set
    seq_low to the mid from the negprot we've handed over.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Wed Oct  7 00:54:34 CEST 2015 on sn-devel-104

commit c0aa94ece086cb32df1819ef455343e9acb3832b
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Sep 27 01:58:46 2015 +0200

    s3:smbd: add expected_seq_low arg to smbd_initialize_smb2
    
    This is in preparation of connection passing for multichannel where we
    have to set seq_low to the mid of the passed negprot.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 source3/smbd/globals.h      |  5 +++--
 source3/smbd/process.c      |  2 +-
 source3/smbd/smb2_negprot.c |  2 +-
 source3/smbd/smb2_server.c  | 12 +++++++-----
 4 files changed, 12 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index b107049..b567a58 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -226,8 +226,9 @@ NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
 
 void reply_smb2002(struct smb_request *req, uint16_t choice);
 void reply_smb20ff(struct smb_request *req, uint16_t choice);
-void smbd_smb2_first_negprot(struct smbXsrv_connection *xconn,
-			     const uint8_t *inpdu, size_t size);
+void smbd_smb2_process_negprot(struct smbXsrv_connection *xconn,
+			       uint64_t expected_seq_low,
+			       const uint8_t *inpdu, size_t size);
 
 DATA_BLOB smbd_smb2_generate_outbody(struct smbd_smb2_request *req, size_t size);
 
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 74d34ef..8d9275c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1893,7 +1893,7 @@ static void process_smb(struct smbXsrv_connection *xconn,
 		if (smbd_is_smb2_header(inbuf, nread)) {
 			const uint8_t *inpdu = inbuf + NBT_HDR_SIZE;
 			size_t pdulen = nread - NBT_HDR_SIZE;
-			smbd_smb2_first_negprot(xconn, inpdu, pdulen);
+			smbd_smb2_process_negprot(xconn, 0, inpdu, pdulen);
 			return;
 		} else if (nread >= smb_size && valid_smb_header(inbuf)
 				&& CVAL(inbuf, smb_com) != 0x72) {
diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c
index 18382a9..c04fbca 100644
--- a/source3/smbd/smb2_negprot.c
+++ b/source3/smbd/smb2_negprot.c
@@ -60,7 +60,7 @@ static void reply_smb20xx(struct smb_request *req, uint16_t dialect)
 
 	req->outbuf = NULL;
 
-	smbd_smb2_first_negprot(req->xconn, smb2_inpdu, len);
+	smbd_smb2_process_negprot(req->xconn, 0, smb2_inpdu, len);
 	return;
 }
 
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index a53ddf8..7120ce5 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -200,11 +200,12 @@ bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size)
 	return true;
 }
 
-static NTSTATUS smbd_initialize_smb2(struct smbXsrv_connection *xconn)
+static NTSTATUS smbd_initialize_smb2(struct smbXsrv_connection *xconn,
+				     uint64_t expected_seq_low)
 {
 	TALLOC_FREE(xconn->transport.fde);
 
-	xconn->smb2.credits.seq_low = 0;
+	xconn->smb2.credits.seq_low = expected_seq_low;
 	xconn->smb2.credits.seq_range = 1;
 	xconn->smb2.credits.granted = 1;
 	xconn->smb2.credits.max = lp_smb2_max_credits();
@@ -3149,8 +3150,9 @@ static NTSTATUS smbd_smb2_request_next_incoming(struct smbXsrv_connection *xconn
 	return NT_STATUS_OK;
 }
 
-void smbd_smb2_first_negprot(struct smbXsrv_connection *xconn,
-			     const uint8_t *inpdu, size_t size)
+void smbd_smb2_process_negprot(struct smbXsrv_connection *xconn,
+			       uint64_t expected_seq_low,
+			       const uint8_t *inpdu, size_t size)
 {
 	struct smbd_server_connection *sconn = xconn->client->sconn;
 	NTSTATUS status;
@@ -3159,7 +3161,7 @@ void smbd_smb2_first_negprot(struct smbXsrv_connection *xconn,
 	DEBUG(10,("smbd_smb2_first_negprot: packet length %u\n",
 		 (unsigned int)size));
 
-	status = smbd_initialize_smb2(xconn);
+	status = smbd_initialize_smb2(xconn, 0);
 	if (!NT_STATUS_IS_OK(status)) {
 		smbd_server_connection_terminate(xconn, nt_errstr(status));
 		return;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list