[PATCH] Two small fixes

Jeremy Allison jra at samba.org
Wed Jan 9 17:51:39 UTC 2019


On Wed, Jan 09, 2019 at 08:28:10AM +0100, Volker Lendecke via samba-technical wrote:
> Hi!
> 
> Review appreciated!

RB+ and pushed, although all my autobuilds are failing at the
moment with unrelated errors :-(.

> -- 
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: 0551-370000-0, mailto:kontakt at sernet.de
> Gesch.F.: Dr. Johannes Loxen und Reinhild Jung
> AG Göttingen: HR-B 2816 - http://www.sernet.de

> From b09b668242e51aa848299533a91c9e6becd73558 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Wed, 6 Jun 2018 18:00:22 +0200
> Subject: [PATCH 1/2] dns: Do NULL checks in dns_sign_tsig
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source4/dns_server/dns_crypto.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/source4/dns_server/dns_crypto.c b/source4/dns_server/dns_crypto.c
> index 740e1e4dd53..8c7502628d5 100644
> --- a/source4/dns_server/dns_crypto.c
> +++ b/source4/dns_server/dns_crypto.c
> @@ -393,6 +393,9 @@ WERROR dns_sign_tsig(struct dns_server *dns,
>  	tsig->ttl = 0;
>  	tsig->length = UINT16_MAX;
>  	tsig->rdata.tsig_record.algorithm_name = talloc_strdup(tsig, "gss-tsig");
> +	if (tsig->rdata.tsig_record.algorithm_name == NULL) {
> +		return WERR_NOT_ENOUGH_MEMORY;
> +	}
>  	tsig->rdata.tsig_record.time_prefix = 0;
>  	tsig->rdata.tsig_record.time = current_time;
>  	tsig->rdata.tsig_record.fudge = 300;
> @@ -403,6 +406,9 @@ WERROR dns_sign_tsig(struct dns_server *dns,
>  	if (sig.length > 0) {
>  		tsig->rdata.tsig_record.mac_size = sig.length;
>  		tsig->rdata.tsig_record.mac = talloc_memdup(tsig, sig.data, sig.length);
> +		if (tsig->rdata.tsig_record.mac == NULL) {
> +			return WERR_NOT_ENOUGH_MEMORY;
> +		}
>  	}
>  
>  	if (packet->arcount == 0) {
> -- 
> 2.11.0
> 
> 
> From 1edf8c0eb09eeb466ab40eb4d35f08d1893e9518 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Thu, 14 Jun 2018 17:42:56 +0200
> Subject: [PATCH 2/2] dsdb: Print strerror in addition to errno
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source4/dsdb/dns/dns_update.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/source4/dsdb/dns/dns_update.c b/source4/dsdb/dns/dns_update.c
> index 20052f4e47f..b2b951c0561 100644
> --- a/source4/dsdb/dns/dns_update.c
> +++ b/source4/dsdb/dns/dns_update.c
> @@ -327,8 +327,8 @@ static void dnsupdate_nameupdate_done(struct tevent_req *subreq)
>  	TALLOC_FREE(subreq);
>  
>  	if (ret != 0) {
> -		DEBUG(0,(__location__ ": Failed DNS update - with error code %d\n",
> -			 sys_errno));
> +		DBG_ERR("Failed DNS update - with error code %d: %s\n",
> +			sys_errno, strerror(sys_errno));
>  	} else {
>  		DEBUG(3,("Completed DNS update check OK\n"));
>  	}
> -- 
> 2.11.0
> 




More information about the samba-technical mailing list