[SCM] Samba Shared Repository - branch v4-9-test updated

Karolin Seeger kseeger at samba.org
Wed Sep 11 13:28:03 UTC 2019


The branch, v4-9-test has been updated
       via  36439305afc libcli/smb: send SMB2_NETNAME_NEGOTIATE_CONTEXT_ID
       via  9b60134b8bb libcli/smb: add new COMPRESSION and NETNAME negotiate context ids
       via  00a810d8fdd s3:ldap: Fix join with don't exists machine account
      from  b9f1be5cf45 ctdb: fix compilation on systems with glibc robust mutexes

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


- Log -----------------------------------------------------------------
commit 36439305afc0b044d21ab00f946e0f4d86751206
Author: Stefan Metzmacher <metze at samba.org>
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 <metze at samba.org>
    Reviewed-by: Aurelien Aptel <aaptel at suse.com>
    (similar to commit 21f6cece543dd791e0f4636458bfe9819823420c)
    
    Autobuild-User(v4-9-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-9-test): Wed Sep 11 13:27:24 UTC 2019 on sn-devel-144

commit 9b60134b8bba23786c5e5473a031bc90a4b3b4be
Author: Stefan Metzmacher <metze at samba.org>
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 <metze at samba.org>
    Reviewed-by: Aurelien Aptel <aaptel at suse.com>
    (cherry picked from commit e10b90f33bb812600886656a1124e2d434416563)

commit 00a810d8fdd27da712c4c035aa00dbc2a304f690
Author: Evgeny Sinelnikov <sin at altlinux.org>
Date:   Wed Jul 31 23:17:20 2019 +0400

    s3:ldap: Fix join with don't exists machine account
    
    Add check for requested replies of existing machine object during join
    machine to domain. This solves regression fail during join with error:
    "None of the information to be translated has been translated."
    
    https://bugzilla.samba.org/show_bug.cgi?id=14007
    
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Wed Sep  4 17:02:37 UTC 2019 on sn-devel-184
    
    (cherry picked from commit ad4ef1657e9b2a088a3bfadcce196cfcceead1dc)

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

Summary of changes:
 libcli/smb/smb2_constants.h |  2 ++
 libcli/smb/smbXcli_base.c   | 17 +++++++++++++++++
 source3/libads/ldap.c       |  5 +++--
 3 files changed, 22 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smb2_constants.h b/libcli/smb/smb2_constants.h
index f6edf6ba109..e50e437d058 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 a8c73be445a..4bbe6167053 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;
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index e191ea792a8..1f0fe966028 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2121,13 +2121,14 @@ ADS_STATUS ads_create_machine_acct(ADS_STRUCT *ads,
 	}
 
 	ret = ads_find_machine_acct(ads, &res, machine_escaped);
-	ads_msgfree(ads, res);
-	if (ADS_ERR_OK(ret)) {
+	if (ADS_ERR_OK(ret) && ads_count_replies(ads, res) == 1) {
 		DBG_DEBUG("Host account for %s already exists.\n",
 				machine_escaped);
 		ret = ADS_ERROR_LDAP(LDAP_ALREADY_EXISTS);
+		ads_msgfree(ads, res);
 		goto done;
 	}
+	ads_msgfree(ads, res);
 
 	new_dn = talloc_asprintf(ctx, "cn=%s,%s", machine_escaped, org_unit);
 	samAccountName = talloc_asprintf(ctx, "%s$", machine_name);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list