The branch, v4-11-test has been updated
       via  d01dbe68cdf libcli/smb: send SMB2_NETNAME_NEGOTIATE_CONTEXT_ID
       via  bff4ee33420 libcli/smb: add new COMPRESSION and NETNAME negotiate 
context ids
      from  11c2b21b97d ctdb: fix compilation on systems with glibc robust 
mutexes

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-11-test


- Log -----------------------------------------------------------------
commit d01dbe68cdfcd873f53c02c9529a944bf209c58f
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Jul 25 14:38:26 2019 +0200

    libcli/smb: send SMB2_NETNAME_NEGOTIATE_CONTEXT_ID
    
    Note: Unlike the current documentation, the utf16 string
    is not null-terminated, that matches Windows Server 1903
    as a client.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14055
    RN: Add the target server name of SMB 3.1.1 connections
    as a hint to load balancers or servers with "multi-tenancy"
    support.
    
    Signed-off-by: Stefan Metzmacher <[email protected]>
    Reviewed-by: Aurelien Aptel <[email protected]>
    (cherry picked from commit 21f6cece543dd791e0f4636458bfe9819823420c)
    
    Autobuild-User(v4-11-test): Karolin Seeger <[email protected]>
    Autobuild-Date(v4-11-test): Mon Sep  9 12:03:55 UTC 2019 on sn-devel-184

commit bff4ee33420557c6b80646a94de926d4f4c0f24d
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Jul 25 14:37:31 2019 +0200

    libcli/smb: add new COMPRESSION and NETNAME negotiate context ids
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14055
    
    Signed-off-by: Stefan Metzmacher <[email protected]>
    Reviewed-by: Aurelien Aptel <[email protected]>
    (cherry picked from commit e10b90f33bb812600886656a1124e2d434416563)

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

Summary of changes:
 libcli/smb/smb2_constants.h |  2 ++
 libcli/smb/smbXcli_base.c   | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smb2_constants.h b/libcli/smb/smb2_constants.h
index 3dd462cdd69..1430f02689c 100644
--- a/libcli/smb/smb2_constants.h
+++ b/libcli/smb/smb2_constants.h
@@ -131,6 +131,8 @@
 /* Types of SMB2 Negotiate Contexts - only in dialect >= 0x310 */
 #define SMB2_PREAUTH_INTEGRITY_CAPABILITIES 0x0001
 #define SMB2_ENCRYPTION_CAPABILITIES        0x0002
+#define SMB2_COMPRESSION_CAPABILITIES       0x0003
+#define SMB2_NETNAME_NEGOTIATE_CONTEXT_ID   0x0005
 
 /* Values for the SMB2_PREAUTH_INTEGRITY_CAPABILITIES Context (>= 0x310) */
 #define SMB2_PREAUTH_INTEGRITY_SHA512       0x0001
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 2f5fac08128..c9b396106ae 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -4770,6 +4770,8 @@ static struct tevent_req 
*smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta
        if (state->conn->max_protocol >= PROTOCOL_SMB3_10) {
                NTSTATUS status;
                struct smb2_negotiate_contexts c = { .num_contexts = 0, };
+               uint8_t *netname_utf16 = NULL;
+               size_t netname_utf16_len = 0;
                uint32_t offset;
                DATA_BLOB b;
                uint8_t p[38];
@@ -4802,6 +4804,21 @@ static struct tevent_req 
*smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta
                        return NULL;
                }
 
+               ok = convert_string_talloc(state, CH_UNIX, CH_UTF16,
+                                          state->conn->remote_name,
+                                          strlen(state->conn->remote_name),
+                                          &netname_utf16, &netname_utf16_len);
+               if (!ok) {
+                       return NULL;
+               }
+
+               status = smb2_negotiate_context_add(state, &c,
+                                       SMB2_NETNAME_NEGOTIATE_CONTEXT_ID,
+                                       netname_utf16, netname_utf16_len);
+               if (!NT_STATUS_IS_OK(status)) {
+                       return NULL;
+               }
+
                status = smb2_negotiate_context_push(state, &b, c);
                if (!NT_STATUS_IS_OK(status)) {
                        return NULL;


-- 
Samba Shared Repository

Reply via email to