[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Mon Sep 5 06:58:03 MDT 2011


The branch, master has been updated
       via  d7eb4a4 libcli/smb: add PROTOCOL_SMB2_10
       via  7fd075f libcli/smb: remove PROTOCOL_SMB2 alias of PROTOCOL_SMB2_02
       via  491c975 s3:smbd: make use of PROTOCOL_SMB2_02
       via  3102bc9 s4:libcli/raw: make use of PROTOCOL_SMB2_02
       via  592ac97 s4:ntvfs: s/!= PROTOCOL_SMB2/< PROTOCOL_SMB2_02/
       via  1ba5077 s4:ntvfs: s/== PROTOCOL_SMB2/>= PROTOCOL_SMB2_02/
       via  d9c2aaa s4:smb_server: make use of PROTOCOL_SMB2_02
       via  b489388 s4:param: make use of PROTOCOL_SMB2_02
       via  0ed0a66 libcli/smb: move smb2_signing.c to the toplevel
      from  5064876 s4-cracknames: fixed cracknames to use more specific search

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


- Log -----------------------------------------------------------------
commit d7eb4a4c85c8cfbc6335b311e09de8d3c5081b14
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:13:04 2011 +0200

    libcli/smb: add PROTOCOL_SMB2_10
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Mon Sep  5 14:57:06 CEST 2011 on sn-devel-104

commit 7fd075f91b3b7c5d5a95cde54c5206d763ff8d65
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:12:38 2011 +0200

    libcli/smb: remove PROTOCOL_SMB2 alias of PROTOCOL_SMB2_02
    
    metze

commit 491c975dfe0c9a70bd2ad22329c1aeb2bf97b4b6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:24:08 2011 +0200

    s3:smbd: make use of PROTOCOL_SMB2_02
    
    metze

commit 3102bc94240f33518d0ff74eee4f93237fe4563f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:23:36 2011 +0200

    s4:libcli/raw: make use of PROTOCOL_SMB2_02
    
    metze

commit 592ac97728e091e3f126f0c05255255b565c5500
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:11:37 2011 +0200

    s4:ntvfs: s/!= PROTOCOL_SMB2/< PROTOCOL_SMB2_02/
    
    metze

commit 1ba5077e5f1db07662f895e068c505479be29b48
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:10:42 2011 +0200

    s4:ntvfs: s/== PROTOCOL_SMB2/>= PROTOCOL_SMB2_02/
    
    metze

commit d9c2aaa0008d6e3f52b6e9b47366c052ab8df9f0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:08:36 2011 +0200

    s4:smb_server: make use of PROTOCOL_SMB2_02
    
    metze

commit b4893885098fb4d2094a0417e0b9700a329bc8ac
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 5 13:08:09 2011 +0200

    s4:param: make use of PROTOCOL_SMB2_02
    
    metze

commit 0ed0a669566a0fe2f3a0357e35080346b550fb1d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Aug 31 01:42:09 2011 +0200

    libcli/smb: move smb2_signing.c to the toplevel
    
    metze

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

Summary of changes:
 {source3/smbd => libcli/smb}/smb2_signing.c |    3 +--
 libcli/smb/{smb_common.h => smb2_signing.h} |   23 +++++++++++++----------
 libcli/smb/smb_common.h                     |    1 +
 libcli/smb/smb_constants.h                  |    4 ++--
 libcli/smb/wscript_build                    |    7 +++++--
 source3/Makefile.in                         |    2 +-
 source3/smbd/globals.h                      |    7 -------
 source3/smbd/negprot.c                      |    2 +-
 source3/wscript_build                       |    1 -
 source4/libcli/raw/rawnegotiate.c           |    2 +-
 source4/ntvfs/common/brlock_tdb.c           |    2 +-
 source4/ntvfs/posix/pvfs_acl.c              |   10 +++++-----
 source4/ntvfs/posix/pvfs_fileinfo.c         |    2 +-
 source4/ntvfs/posix/pvfs_lock.c             |    2 +-
 source4/ntvfs/posix/pvfs_open.c             |    4 ++--
 source4/ntvfs/posix/pvfs_qfileinfo.c        |    2 +-
 source4/ntvfs/posix/pvfs_read.c             |    4 ++--
 source4/ntvfs/posix/pvfs_resolve.c          |    2 +-
 source4/ntvfs/posix/pvfs_setfileinfo.c      |    6 +++---
 source4/param/loadparm.c                    |    3 ++-
 source4/smb_server/smb/negprot.c            |    2 +-
 source4/smb_server/smb2/negprot.c           |    2 +-
 source4/smb_server/smb_server.c             |    2 +-
 23 files changed, 47 insertions(+), 48 deletions(-)
 rename {source3/smbd => libcli/smb}/smb2_signing.c (98%)
 copy libcli/smb/{smb_common.h => smb2_signing.h} (67%)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_signing.c b/libcli/smb/smb2_signing.c
similarity index 98%
rename from source3/smbd/smb2_signing.c
rename to libcli/smb/smb2_signing.c
index 1c0dd5e..3687ace 100644
--- a/source3/smbd/smb2_signing.c
+++ b/libcli/smb/smb2_signing.c
@@ -19,8 +19,7 @@
 */
 
 #include "includes.h"
-#include "smbd/smbd.h"
-#include "smbd/globals.h"
+#include "system/filesys.h"
 #include "../libcli/smb/smb_common.h"
 #include "../lib/crypto/crypto.h"
 
diff --git a/libcli/smb/smb_common.h b/libcli/smb/smb2_signing.h
similarity index 67%
copy from libcli/smb/smb_common.h
copy to libcli/smb/smb2_signing.h
index 83f7db2..3c3e0c2 100644
--- a/libcli/smb/smb_common.h
+++ b/libcli/smb/smb2_signing.h
@@ -1,7 +1,6 @@
 /*
    Unix SMB/CIFS implementation.
-
-   SMB and SMB2 common header
+   SMB2 signing
 
    Copyright (C) Stefan Metzmacher 2009
 
@@ -19,13 +18,17 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef __LIBCLI_SMB_SMB_COMMON_H__
-#define __LIBCLI_SMB_SMB_COMMON_H__
+#ifndef _LIBCLI_SMB_SMB2_SIGNING_H_
+#define _LIBCLI_SMB_SMB2_SIGNING_H_
+
+struct iovec;
+
+NTSTATUS smb2_signing_sign_pdu(DATA_BLOB session_key,
+			       struct iovec *vector,
+			       int count);
 
-#include "libcli/smb/smb2_constants.h"
-#include "libcli/smb/smb2_create_blob.h"
-#include "libcli/smb/smb_constants.h"
-#include "libcli/smb/smb_util.h"
-#include "libcli/smb/smb_unix_ext.h"
+NTSTATUS smb2_signing_check_pdu(DATA_BLOB session_key,
+				const struct iovec *vector,
+				int count);
 
-#endif
+#endif /* _LIBCLI_SMB_SMB2_SIGNING_H_ */
diff --git a/libcli/smb/smb_common.h b/libcli/smb/smb_common.h
index 83f7db2..1f21e55 100644
--- a/libcli/smb/smb_common.h
+++ b/libcli/smb/smb_common.h
@@ -24,6 +24,7 @@
 
 #include "libcli/smb/smb2_constants.h"
 #include "libcli/smb/smb2_create_blob.h"
+#include "libcli/smb/smb2_signing.h"
 #include "libcli/smb/smb_constants.h"
 #include "libcli/smb/smb_util.h"
 #include "libcli/smb/smb_unix_ext.h"
diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h
index f833b25..11b1394 100644
--- a/libcli/smb/smb_constants.h
+++ b/libcli/smb/smb_constants.h
@@ -41,9 +41,9 @@ enum protocol_types {
 	PROTOCOL_LANMAN1,
 	PROTOCOL_LANMAN2,
 	PROTOCOL_NT1,
-	PROTOCOL_SMB2_02
+	PROTOCOL_SMB2_02,
+	PROTOCOL_SMB2_10
 };
-#define PROTOCOL_SMB2 PROTOCOL_SMB2_02
 
 /* NT Flags2 bits - cifs6.txt section 3.1.2 */
 #define FLAGS2_LONG_PATH_COMPONENTS    0x0001
diff --git a/libcli/smb/wscript_build b/libcli/smb/wscript_build
index 89ecf51..66319e9 100644
--- a/libcli/smb/wscript_build
+++ b/libcli/smb/wscript_build
@@ -2,9 +2,12 @@
 
 
 bld.SAMBA_LIBRARY('cli_smb_common',
-	source='smb2_create_blob.c util.c',
+	source='smb2_create_blob.c smb2_signing.c util.c',
 	autoproto='smb_common_proto.h',
+	deps='LIBCRYPTO',
 	public_deps='talloc samba-util',
 	private_library=True,
-	public_headers='smb_common.h smb2_constants.h smb2_create_blob.h',
+	public_headers='''smb_common.h smb2_constants.h
+			smb2_create_blob.h smb2_signing.h
+	''',
 	)
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 9236750..bf66af4 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -601,6 +601,7 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
 	     libsmb/smb2cli_tcon.o \
 	     libsmb/smb2cli_create.o \
 	     ../libcli/smb/smb2_create_blob.o \
+	     ../libcli/smb/smb2_signing.o \
 	     libsmb/smb2cli_close.o \
 	     libsmb/smb2cli_flush.o \
 	     libsmb/smb2cli_read.o \
@@ -929,7 +930,6 @@ SMBD_OBJ_SRV = smbd/server_reload.o \
 	       smbd/file_access.o \
 	       smbd/dnsregister.o smbd/globals.o \
 	       smbd/smb2_server.o \
-	       smbd/smb2_signing.o \
 	       smbd/smb2_glue.o \
 	       smbd/smb2_negprot.o \
 	       smbd/smb2_sesssetup.o \
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 35c44ee..2e59d9b 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -133,13 +133,6 @@ DATA_BLOB negprot_spnego(TALLOC_CTX *ctx, struct smbd_server_connection *sconn);
 void smbd_lock_socket(struct smbd_server_connection *sconn);
 void smbd_unlock_socket(struct smbd_server_connection *sconn);
 
-NTSTATUS smb2_signing_sign_pdu(DATA_BLOB session_key,
-			       struct iovec *vector,
-			       int count);
-NTSTATUS smb2_signing_check_pdu(DATA_BLOB session_key,
-				const struct iovec *vector,
-				int count);
-
 NTSTATUS smbd_do_locking(struct smb_request *req,
 			 files_struct *fsp,
 			 uint8_t type,
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 236b4d6..49b9420 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -743,7 +743,7 @@ void reply_negprot(struct smb_request *req)
 
 	TALLOC_FREE(cliprotos);
 
-	if (lp_async_smb_echo_handler() && (get_Protocol() < PROTOCOL_SMB2) &&
+	if (lp_async_smb_echo_handler() && (get_Protocol() < PROTOCOL_SMB2_02) &&
 	    !fork_echo_handler(sconn)) {
 		exit_server("Failed to fork echo handler");
 	}
diff --git a/source3/wscript_build b/source3/wscript_build
index a144549..5414e6c 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -377,7 +377,6 @@ SMBD_SRC_SRV = '''smbd/server_reload.c smbd/files.c smbd/connection.c
                smbd/file_access.c
                smbd/dnsregister.c smbd/globals.c
                smbd/smb2_server.c
-               smbd/smb2_signing.c
                smbd/smb2_glue.c
                smbd/smb2_negprot.c
                smbd/smb2_sesssetup.c
diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c
index 4f8c13e..9d6c9ff 100644
--- a/source4/libcli/raw/rawnegotiate.c
+++ b/source4/libcli/raw/rawnegotiate.c
@@ -42,7 +42,7 @@ static const struct {
 	{PROTOCOL_NT1,"NT LM 0.12"},
 #if 0
 	/* we don't yet handle chaining a SMB transport onto SMB2 */
-	{PROTOCOL_SMB2,"SMB 2.002"},
+	{PROTOCOL_SMB2_02,"SMB 2.002"},
 #endif
 };
 
diff --git a/source4/ntvfs/common/brlock_tdb.c b/source4/ntvfs/common/brlock_tdb.c
index 8174483..fcaa756 100644
--- a/source4/ntvfs/common/brlock_tdb.c
+++ b/source4/ntvfs/common/brlock_tdb.c
@@ -242,7 +242,7 @@ static NTSTATUS brl_tdb_lock_failed(struct brl_handle *brlh, struct lock_struct
 	 */
 
 	/* in SMB2 mode always return NT_STATUS_LOCK_NOT_GRANTED! */
-	if (lock->ntvfs->ctx->protocol == PROTOCOL_SMB2) {
+	if (lock->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02) {
 		return NT_STATUS_LOCK_NOT_GRANTED;
 	}
 
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index d7a778e..cbe3e4e 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -568,7 +568,7 @@ static NTSTATUS pvfs_access_check_unix(struct pvfs_state *pvfs,
 		return NT_STATUS_ACCESS_DENIED;
 	}
 
-	if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+	if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
 		/* on SMB, this bit is always granted, even if not
 		   asked for */
 		*access_mask |= SEC_FILE_READ_ATTRIBUTE;
@@ -595,7 +595,7 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
 	bool allow_delete = false;
 
 	/* on SMB2 a blank access mask is always denied */
-	if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2 &&
+	if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02 &&
 	    *access_mask == 0) {
 		return NT_STATUS_ACCESS_DENIED;
 	}
@@ -621,7 +621,7 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
 
 	/* expand the generic access bits to file specific bits */
 	*access_mask = pvfs_translate_mask(*access_mask);
-	if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+	if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
 		*access_mask &= ~SEC_FILE_READ_ATTRIBUTE;
 	}
 
@@ -647,7 +647,7 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
 	status = se_access_check(sd, token, *access_mask, access_mask);
 	talloc_free(acl);
 done:
-	if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+	if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
 		/* on SMB, this bit is always granted, even if not
 		   asked for */
 		*access_mask |= SEC_FILE_READ_ATTRIBUTE;
@@ -745,7 +745,7 @@ NTSTATUS pvfs_access_check_create(struct pvfs_state *pvfs,
 		*access_mask &= ~SEC_FLAG_MAXIMUM_ALLOWED;
 	}
 
-	if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+	if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
 		/* on SMB, this bit is always granted, even if not
 		   asked for */
 		*access_mask |= SEC_FILE_READ_ATTRIBUTE;
diff --git a/source4/ntvfs/posix/pvfs_fileinfo.c b/source4/ntvfs/posix/pvfs_fileinfo.c
index a372383..b1fd55a 100644
--- a/source4/ntvfs/posix/pvfs_fileinfo.c
+++ b/source4/ntvfs/posix/pvfs_fileinfo.c
@@ -82,7 +82,7 @@ NTSTATUS pvfs_fill_dos_info(struct pvfs_state *pvfs, struct pvfs_filename *name,
 	name->dos.alloc_size = pvfs_round_alloc_size(pvfs, name->st.st_size);
 	name->dos.nlink = name->st.st_nlink;
 	name->dos.ea_size = 4;
-	if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2) {
+	if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02) {
 		/* SMB2 represents a null EA with zero bytes */
 		name->dos.ea_size = 0;
 	}
diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c
index 0d99860..54c7a33 100644
--- a/source4/ntvfs/posix/pvfs_lock.c
+++ b/source4/ntvfs/posix/pvfs_lock.c
@@ -116,7 +116,7 @@ static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice
 
 	/* we don't retry on a cancel */
 	if (reason == PVFS_WAIT_CANCEL) {
-		if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+		if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
 			status = NT_STATUS_FILE_LOCK_CONFLICT;
 		} else {
 			status = NT_STATUS_CANCELLED;
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index d56bce5..c0f55e8 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -1284,7 +1284,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
 	}
 
 	/* what does this bit really mean?? */
-	if (req->ctx->protocol == PROTOCOL_SMB2 &&
+	if (req->ctx->protocol >= PROTOCOL_SMB2_02 &&
 	    access_mask == SEC_STD_SYNCHRONIZE) {
 		return NT_STATUS_ACCESS_DENIED;
 	}
@@ -1502,7 +1502,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
 	 * on existing files
 	 */
 	if (create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE &&
-	    req->ctx->protocol == PROTOCOL_SMB2) {
+	    req->ctx->protocol >= PROTOCOL_SMB2_02) {
 		del_on_close = true;
 	} else {
 		del_on_close = false;
diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c
index 9284306..ac3e6a6 100644
--- a/source4/ntvfs/posix/pvfs_qfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_qfileinfo.c
@@ -222,7 +222,7 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
 
 	case RAW_FILEINFO_NAME_INFO:
 	case RAW_FILEINFO_NAME_INFORMATION:
-		if (req->ctx->protocol == PROTOCOL_SMB2) {
+		if (req->ctx->protocol >= PROTOCOL_SMB2_02) {
 			/* strange that SMB2 doesn't have this */
 			return NT_STATUS_NOT_SUPPORTED;
 		}
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c
index d25036a..f60b721 100644
--- a/source4/ntvfs/posix/pvfs_read.c
+++ b/source4/ntvfs/posix/pvfs_read.c
@@ -59,7 +59,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
 	}
 
 	maxcnt = rd->readx.in.maxcnt;
-	if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2) {
+	if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2_02) {
 		DEBUG(3,(__location__ ": Invalid SMB maxcnt 0x%x\n", maxcnt));
 		return NT_STATUS_INVALID_PARAMETER;
 	}
@@ -96,7 +96,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
 	}
 
 	/* only SMB2 honors mincnt */
-	if (req->ctx->protocol == PROTOCOL_SMB2) {
+	if (req->ctx->protocol >= PROTOCOL_SMB2_02) {
 		if (rd->readx.in.mincnt > ret ||
 		    (ret == 0 && maxcnt > 0)) {
 			return NT_STATUS_END_OF_FILE;
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c
index 0da64a7..2557283 100644
--- a/source4/ntvfs/posix/pvfs_resolve.c
+++ b/source4/ntvfs/posix/pvfs_resolve.c
@@ -524,7 +524,7 @@ NTSTATUS pvfs_resolve_name(struct pvfs_state *pvfs,
 	}
 
 	/* SMB2 doesn't allow a leading slash */
-	if (req->ctx->protocol == PROTOCOL_SMB2 &&
+	if (req->ctx->protocol >= PROTOCOL_SMB2_02 &&
 	    *cifs_name == '\\') {
 		return NT_STATUS_INVALID_PARAMETER;
 	}
diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c
index ca8e9cb..cbb5c78 100644
--- a/source4/ntvfs/posix/pvfs_setfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_setfileinfo.c
@@ -130,7 +130,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
 
 	/* renames are only allowed within a directory */
 	if (strchr_m(info->rename_information.in.new_name, '\\') &&
-	    (req->ctx->protocol != PROTOCOL_SMB2)) {
+	    (req->ctx->protocol < PROTOCOL_SMB2_02)) {
 		return NT_STATUS_NOT_SUPPORTED;
 	}
 
@@ -143,12 +143,12 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
 	/* w2k3 does not appear to allow relative rename. On SMB2, vista sends it sometimes,
 	   but I suspect it is just uninitialised memory */
 	if (info->rename_information.in.root_fid != 0 && 
-	    (req->ctx->protocol != PROTOCOL_SMB2)) {
+	    (req->ctx->protocol < PROTOCOL_SMB2_02)) {
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
 	/* construct the fully qualified windows name for the new file name */
-	if (req->ctx->protocol == PROTOCOL_SMB2) {
+	if (req->ctx->protocol >= PROTOCOL_SMB2_02) {
 		/* SMB2 sends the full path of the new name */
 		new_name = talloc_asprintf(req, "\\%s", info->rename_information.in.new_name);
 	} else {
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 14cc479..c29097f 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -105,7 +105,8 @@ static bool handle_logfile(struct loadparm_context *lp_ctx, int unused,
 			   const char *pszParmValue, char **ptr);
 
 static const struct enum_list enum_protocol[] = {
-	{PROTOCOL_SMB2, "SMB2"},
+	{PROTOCOL_SMB2_02, "SMB2"},
+	{PROTOCOL_SMB2_02, "SMB2_02"},
 	{PROTOCOL_NT1, "NT1"},
 	{PROTOCOL_LANMAN2, "LANMAN2"},
 	{PROTOCOL_LANMAN1, "LANMAN1"},
diff --git a/source4/smb_server/smb/negprot.c b/source4/smb_server/smb/negprot.c
index 0a07ab9..378330f 100644
--- a/source4/smb_server/smb/negprot.c
+++ b/source4/smb_server/smb/negprot.c
@@ -465,7 +465,7 @@ static const struct {
 	void (*proto_reply_fn)(struct smbsrv_request *req, uint16_t choice);
 	int protocol_level;
 } supported_protocols[] = {
-	{"SMB 2.002",			"SMB2",		reply_smb2,	PROTOCOL_SMB2},
+	{"SMB 2.002",			"SMB2",		reply_smb2,	PROTOCOL_SMB2_02},
 	{"NT LANMAN 1.0",		"NT1",		reply_nt1,	PROTOCOL_NT1},
 	{"NT LM 0.12",			"NT1",		reply_nt1,	PROTOCOL_NT1},
 	{"LANMAN2.1",			"LANMAN2",	reply_lanman2,	PROTOCOL_LANMAN2},
diff --git a/source4/smb_server/smb2/negprot.c b/source4/smb_server/smb2/negprot.c
index da60676..bc896aa 100644
--- a/source4/smb_server/smb2/negprot.c
+++ b/source4/smb_server/smb2/negprot.c
@@ -113,7 +113,7 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2
 		return NT_STATUS_NOT_SUPPORTED;
 	}
 
-	req->smb_conn->negotiate.protocol = PROTOCOL_SMB2;
+	req->smb_conn->negotiate.protocol = PROTOCOL_SMB2_02;
 
 	current_time = timeval_current(); /* TODO: handle timezone?! */
 	boot_time = timeval_current(); /* TODO: fix me */
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index d64a597..270e107 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -63,7 +63,7 @@ static NTSTATUS smbsrv_recv_generic_request(void *private_data, DATA_BLOB blob)
 		packet_set_callback(smb_conn->packet, smbsrv_recv_smb_request);
 		return smbsrv_recv_smb_request(smb_conn, blob);
 	case SMB2_MAGIC:
-		if (lpcfg_srv_maxprotocol(smb_conn->lp_ctx) < PROTOCOL_SMB2) break;
+		if (lpcfg_srv_maxprotocol(smb_conn->lp_ctx) < PROTOCOL_SMB2_02) break;
 		status = smbsrv_init_smb2_connection(smb_conn);
 		NT_STATUS_NOT_OK_RETURN(status);
 		packet_set_callback(smb_conn->packet, smbsrv_recv_smb2_request);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list