[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-972-g5b4b335

Jeremy Allison jra at samba.org
Sun Dec 30 21:23:22 GMT 2007


The branch, v3-2-test has been updated
       via  5b4b335ed0d1dc738f1f099e5c638361f3aede07 (commit)
      from  a0494b115b644c1c4afa50442c46a54779687571 (commit)

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


- Log -----------------------------------------------------------------
commit 5b4b335ed0d1dc738f1f099e5c638361f3aede07
Author: Jeremy Allison <jra at samba.org>
Date:   Sun Dec 30 13:10:29 2007 -0800

    As the encryption is stream based there's no reason
    oplock breaks can't be encrypted. If we have multiple
    contexts I should probably attach them to the connection
    struct, but for now use the global context number.
    Jeremy.

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

Summary of changes:
 source/smbd/oplock.c |   12 +++++++-----
 source/smbd/seal.c   |    9 +++++++++
 2 files changed, 16 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/oplock.c b/source/smbd/oplock.c
index 2c33136..8a5b1f4 100644
--- a/source/smbd/oplock.c
+++ b/source/smbd/oplock.c
@@ -252,11 +252,13 @@ static char *new_break_smb_message(TALLOC_CTX *mem_ctx,
 	}
 
 	memset(result,'\0',smb_size);
-	/* We use cli_set_message here as this is an
-	 * asynchronous message that doesn't belong in
-	 * the stream.
-	 */
-	cli_set_message(result,8,0,True);
+	if (!srv_encryption_on()) {
+		cli_set_message(result,8,0,true);
+	} else {
+		char inbuf[8];
+		smb_set_enclen(inbuf,4,srv_enc_ctx());
+		srv_set_message(inbuf,result,8,0,true);
+	}
 	SCVAL(result,smb_com,SMBlockingX);
 	SSVAL(result,smb_tid,fsp->conn->cnum);
 	SSVAL(result,smb_pid,0xFFFF);
diff --git a/source/smbd/seal.c b/source/smbd/seal.c
index 14a427b..24ecb77 100644
--- a/source/smbd/seal.c
+++ b/source/smbd/seal.c
@@ -48,6 +48,15 @@ bool srv_encryption_on(void)
 }
 
 /******************************************************************************
+ Return global enc context - this must change if we ever do multiple contexts.
+******************************************************************************/
+
+uint16 srv_enc_ctx(void)
+{
+	return srv_trans_enc_ctx->es->enc_ctx_num;
+}
+
+/******************************************************************************
  Create an auth_ntlmssp_state and ensure pointer copy is correct.
 ******************************************************************************/
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list