From f1387514c68c338fe35ed4bfaa73ec06136a9f92 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 30 Jan 2023 11:18:49 +1100 Subject: [PATCH 1/2] Handle address lookup failure more gracefully If the address lookup of the primary server fails just abort the current update request rather than calling exit. This allows nsupdate to cleanup gracefully. --- bin/nsupdate/nsupdate.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index a67a651db6..49ee0e3b08 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -2797,8 +2797,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) { dns_request_destroy(&request); dns_message_detach(&soaquery); ddebug("Out of recvsoa"); - done_update(); seenerror = true; + done_update(); return; } @@ -2903,7 +2903,14 @@ lookforsoa: primary_total = get_addresses(serverstr, dnsport, primary_servers, primary_alloc); if (primary_total == 0) { - exit(1); + seenerror = true; + dns_rdata_freestruct(&soa); + dns_message_detach(&soaquery); + dns_request_destroy(&request); + dns_message_detach(&rcvmsg); + ddebug("Out of recvsoa"); + done_update(); + return; } primary_inuse = 0; } else { From fda7858e748fbbadbd14ca7b0069ba7494bbc613 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 30 Jan 2023 12:15:57 +1100 Subject: [PATCH 2/2] Add CHANGES for [GL #3830] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index b53b2eb37f..3fb443708c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +6081. [bug] Handle primary server address lookup failures in + nsupdate more gracefully. [GL #3830] + 6080. [bug] 'named -V' leaked memory. [GL #3829] 6079. [bug] Force set the DS state after a 'rdnc dnssec -checkds'