[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Jun 1 12:07:02 UTC 2018


The branch, master has been updated
       via  c56cd28 dns: Check for talloc_memdup failure
       via  341b470 dns: TALLOC_FREE already checks for !=NULL
       via  d8acbe7 dns: Simplify logic a bit
       via  d3c82e6 dns: Simplify logic a bit
       via  82175c0 dnsupdate: Fix a typo
      from  d161aa3 ldb: Fix memory leak on module context

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


- Log -----------------------------------------------------------------
commit c56cd283f5796ea22e2cceb0d058473b8fe299fd
Author: Volker Lendecke <vl at samba.org>
Date:   Thu May 31 21:16:21 2018 +0200

    dns: Check for talloc_memdup failure
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Jun  1 14:05:56 CEST 2018 on sn-devel-144

commit 341b470854abfc187a752721dcb684e9a91c2d13
Author: Volker Lendecke <vl at samba.org>
Date:   Thu May 31 21:11:16 2018 +0200

    dns: TALLOC_FREE already checks for !=NULL
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d8acbe73d93d02887583c0f8d7c4dbff1638520a
Author: Volker Lendecke <vl at samba.org>
Date:   Thu May 31 20:57:36 2018 +0200

    dns: Simplify logic a bit
    
    We don't need a separate boolean variable
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d3c82e686b18366ffa3db1cd4ed5c33bd3b0e86c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu May 31 20:56:31 2018 +0200

    dns: Simplify logic a bit
    
    We've done an early return if (!found_tsig) a few lines before.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 82175c0b9101908b5b258b2e41f322bbfdb68a04
Author: Volker Lendecke <vl at samba.org>
Date:   Wed May 30 17:24:35 2018 +0200

    dnsupdate: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 source4/dns_server/dns_crypto.c       | 7 +++----
 source4/dns_server/dns_query.c        | 7 ++++---
 source4/scripting/bin/samba_dnsupdate | 2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dns_server/dns_crypto.c b/source4/dns_server/dns_crypto.c
index 0be9b82..740e1e4 100644
--- a/source4/dns_server/dns_crypto.c
+++ b/source4/dns_server/dns_crypto.c
@@ -100,7 +100,6 @@ WERROR dns_verify_tsig(struct dns_server *dns,
 	WERROR werror;
 	NTSTATUS status;
 	enum ndr_err_code ndr_err;
-	bool found_tsig = false;
 	uint16_t i, arcount = 0;
 	DATA_BLOB tsig_blob, fake_tsig_blob, sig;
 	uint8_t *buffer = NULL;
@@ -113,17 +112,17 @@ WERROR dns_verify_tsig(struct dns_server *dns,
 	/* Find the first TSIG record in the additional records */
 	for (i=0; i < packet->arcount; i++) {
 		if (packet->additional[i].rr_type == DNS_QTYPE_TSIG) {
-			found_tsig = true;
 			break;
 		}
 	}
 
-	if (!found_tsig) {
+	if (i == packet->arcount) {
+		/* no TSIG around */
 		return WERR_OK;
 	}
 
 	/* The TSIG record needs to be the last additional record */
-	if (found_tsig && i + 1 != packet->arcount) {
+	if (i + 1 != packet->arcount) {
 		DEBUG(1, ("TSIG record not the last additional record!\n"));
 		return DNS_ERR(FORMAT_ERROR);
 	}
diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c
index f1facc8..923f723 100644
--- a/source4/dns_server/dns_query.c
+++ b/source4/dns_server/dns_query.c
@@ -721,9 +721,7 @@ static NTSTATUS create_tkey(struct dns_server *dns,
 		return status;
 	}
 
-	if (store->tkeys[store->next_idx] != NULL) {
-		TALLOC_FREE(store->tkeys[store->next_idx]);
-	}
+	TALLOC_FREE(store->tkeys[store->next_idx]);
 
 	store->tkeys[store->next_idx] = k;
 	(store->next_idx)++;
@@ -871,6 +869,9 @@ static WERROR handle_tkey(struct dns_server *dns,
 			ret_tkey->rdata.tkey_record.key_data = talloc_memdup(ret_tkey,
 								reply.data,
 								reply.length);
+			if (ret_tkey->rdata.tkey_record.key_data == NULL) {
+				return WERR_NOT_ENOUGH_MEMORY;
+			}
 			state->sign = true;
 			state->key_name = talloc_strdup(state->mem_ctx, tkey->name);
 			if (state->key_name == NULL) {
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 508bd53..2d3fede 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -495,7 +495,7 @@ def call_nsupdate(d, op="add"):
         # Now find the SOA, or if we can't get a ticket to the SOA,
         # any server with an NS record we can get a ticket for.
         #
-        # Thanks to the Kerberos Crednetials cache this is not
+        # Thanks to the Kerberos Credentials cache this is not
         # expensive inside the loop
         server = get_krb5_rw_dns_server(creds, zone)
         f.write('server %s\n' % server)


-- 
Samba Shared Repository



More information about the samba-cvs mailing list