From d9fc95f842a90112a4a37ce3df2689525a2ce021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 26 Oct 2023 10:54:28 +0200 Subject: [PATCH 1/2] Fix assertion failure when using -X and lock-file in configuration When 'lock-file ' was used in configuration at the same time as using `-X ` in `named` invocation, there was an invalid logic that would lead to a double isc_mem_strdup() call on the value. Skip the second allocation if `lock-file` is being used in configuration, so the is used only single time. (cherry picked from commit 4f68def5e966f0d359833b64837e25f0cb60fb6a) --- bin/named/server.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c index 2f21fc5213..3295082f9d 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -8443,10 +8443,7 @@ check_lockfile(named_server_t *server, const cfg_obj_t *config, if (server->lockfile == NULL) { return (ISC_R_NOMEMORY); } - } - - if (named_g_forcelock && named_g_defaultlockfile != NULL) { - INSIST(server->lockfile == NULL); + } else if (named_g_forcelock && named_g_defaultlockfile != NULL) { server->lockfile = isc_mem_strdup(server->mctx, named_g_defaultlockfile); } From cdf7c34a587a65fd3fe24d27722624b40e73c9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 26 Oct 2023 10:59:53 +0200 Subject: [PATCH 2/2] Add CHANGES and release note for [GL #4386] (cherry picked from commit 8294a43acfc2e796be8bee3e7e311162e6a4047d) --- CHANGES | 3 +++ doc/notes/notes-current.rst | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 0c77506969..6377ddedb2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +6275. [bug] Fix assertion failure when using lock-file configuration + option together -X argument to named. [GL #4386] + 6274. [bug] The 'lock-file' file was being removed when it shouldn't have been making it ineffective if named was started 3 or more times. [GL #4387] diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index b857f117a3..4c1c950fc1 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -43,6 +43,9 @@ Bug Fixes have been making it ineffective if named was started 3 or more times. :gl:`#4387` +- When :any:`lock-file` was used at the same time as :option:`named -X`, the + assertion failure would be triggered. This has been fixed. :gl:`#4386` + Known Issues ~~~~~~~~~~~~