From d7c1094d108cfaaa1c95051b01a4f2595d43837d Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 15 May 2023 10:34:16 +1000 Subject: [PATCH 1/2] Properly process extra nameserver lines in resolv.conf The whole line needs to be read rather than just the token "nameserver" otherwise the next line in resolv.conf is not properly processed. (cherry picked from commit 864cd080523fcbafd5a79f69922e4ebe2dd5885f) --- lib/irs/resconf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/irs/resconf.c b/lib/irs/resconf.c index 915abfee44..2cd98aaf0b 100644 --- a/lib/irs/resconf.c +++ b/lib/irs/resconf.c @@ -290,10 +290,6 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) { int cp; isc_result_t result; - if (conf->numns == RESCONFMAXNAMESERVERS) { - return (ISC_R_SUCCESS); - } - cp = getword(fp, word, sizeof(word)); if (strlen(word) == 0U) { return (ISC_R_UNEXPECTEDEND); /* Nothing on line. */ @@ -305,6 +301,10 @@ resconf_parsenameserver(irs_resconf_t *conf, FILE *fp) { return (ISC_R_UNEXPECTEDTOKEN); /* Extra junk on line. */ } + if (conf->numns == RESCONFMAXNAMESERVERS) { + return (ISC_R_SUCCESS); + } + result = add_server(conf->mctx, word, &conf->nameservers); if (result != ISC_R_SUCCESS) { return (result); From 4e9d99818033562ba1aab07a48e8fe2a79655856 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 15 May 2023 10:39:50 +1000 Subject: [PATCH 2/2] Add CHANGES for [GL #4066] (cherry picked from commit 36dab033dc13a8950bec1d48f61f6439a084f73f) --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 339c80767d..64a0dfc9e1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +6173. [bug] Properly process extra "nameserver" lines in + resolv.conf otherwise the next line is not properly + processed. [GL #4066] + 6169. [bug] named could crash when deleting inline-signing zones with "rndc delzone". [GL #4054]