The Samba-Bugzilla – Attachment 15467 Details for
Bug 14055
We should send SMB2_NETNAME_NEGOTIATE_CONTEXT_ID negotiation context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for v4-9-test
tmp49.diff.txt (text/plain), 3.07 KB, created by
Stefan Metzmacher
on 2019-09-10 21:48:40 UTC
(
hide
)
Description:
Patches for v4-9-test
Filename:
MIME Type:
Creator:
Stefan Metzmacher
Created:
2019-09-10 21:48:40 UTC
Size:
3.07 KB
patch
obsolete
>From e10d8d6b82928bf9622d9c5bc3cef8128f08c255 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Thu, 25 Jul 2019 14:37:31 +0200 >Subject: [PATCH 1/2] 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 <metze@samba.org> >Reviewed-by: Aurelien Aptel <aaptel@suse.com> >(cherry picked from commit e10b90f33bb812600886656a1124e2d434416563) >--- > libcli/smb/smb2_constants.h | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/libcli/smb/smb2_constants.h b/libcli/smb/smb2_constants.h >index f6edf6ba109d..e50e437d0584 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 >-- >2.17.1 > > >From 901f88762c155b46cfc5544f7c09e277aeec4c42 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Thu, 25 Jul 2019 14:38:26 +0200 >Subject: [PATCH 2/2] 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 <metze@samba.org> >Reviewed-by: Aurelien Aptel <aaptel@suse.com> >(similar to commit 21f6cece543dd791e0f4636458bfe9819823420c) >--- > libcli/smb/smbXcli_base.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c >index a8c73be445a1..4bbe61670533 100644 >--- a/libcli/smb/smbXcli_base.c >+++ b/libcli/smb/smbXcli_base.c >@@ -4756,6 +4756,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]; >@@ -4790,6 +4792,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; >+ } >+ >+ b = data_blob_const(netname_utf16, netname_utf16_len); >+ status = smb2_negotiate_context_add(state, &c, >+ SMB2_NETNAME_NEGOTIATE_CONTEXT_ID, b); >+ if (!NT_STATUS_IS_OK(status)) { >+ return NULL; >+ } >+ > status = smb2_negotiate_context_push(state, &b, c); > if (!NT_STATUS_IS_OK(status)) { > return NULL; >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
slow
:
review+
Actions:
View
Attachments on
bug 14055
:
15449
|
15450
|
15451
|
15466
| 15467