diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 16:41:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 16:41:28 +0000 |
commit | 14509ce60103dab695cef4d4f31321bab27ab967 (patch) | |
tree | 5959cfb9832b3af242a1ca45d4a1227acae67d87 /bin/named/server.c | |
parent | Adding debian version 1:9.18.19-1~deb12u1. (diff) | |
download | bind9-14509ce60103dab695cef4d4f31321bab27ab967.tar.xz bind9-14509ce60103dab695cef4d4f31321bab27ab967.zip |
Merging upstream version 1:9.18.24.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/named/server.c')
-rw-r--r-- | bin/named/server.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/bin/named/server.c b/bin/named/server.c index 2f21fc5..bfe6df3 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -8407,8 +8407,8 @@ check_lockfile(named_server_t *server, const cfg_obj_t *config, (void)named_config_get(maps, "lock-file", &obj); if (!first_time) { - if (obj != NULL && !cfg_obj_isstring(obj) && - server->lockfile != NULL && + if (obj != NULL && cfg_obj_isstring(obj) && + server->lockfile != NULL && !named_g_forcelock && strcmp(cfg_obj_asstring(obj), server->lockfile) != 0) { isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, @@ -8422,31 +8422,25 @@ check_lockfile(named_server_t *server, const cfg_obj_t *config, } if (obj != NULL) { - if (cfg_obj_isvoid(obj)) { - isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, - NAMED_LOGMODULE_SERVER, ISC_LOG_DEBUG(1), - "skipping lock-file check "); - return (ISC_R_SUCCESS); - } else if (named_g_forcelock) { + if (named_g_forcelock) { isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, "'lock-file' has no effect " "because the server was run with -X"); - server->lockfile = isc_mem_strdup( - server->mctx, named_g_defaultlockfile); - } else { + if (named_g_defaultlockfile != NULL) { + server->lockfile = isc_mem_strdup( + server->mctx, named_g_defaultlockfile); + } + } else if (cfg_obj_isvoid(obj)) { + isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_SERVER, ISC_LOG_DEBUG(1), + "skipping lock-file check"); + } else if (cfg_obj_isstring(obj)) { filename = cfg_obj_asstring(obj); server->lockfile = isc_mem_strdup(server->mctx, filename); } - - 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); } @@ -15850,6 +15844,8 @@ named_server_nta(named_server_t *server, isc_lex_t *lex, bool readonly, * If -dump was specified, list NTA's and return */ if (dump) { + size_t last = 0; + for (view = ISC_LIST_HEAD(server->viewlist); view != NULL; view = ISC_LIST_NEXT(view, link)) { @@ -15861,6 +15857,12 @@ named_server_nta(named_server_t *server, isc_lex_t *lex, bool readonly, continue; } + if (last != isc_buffer_usedlength(*text)) { + CHECK(putstr(text, "\n")); + } + + last = isc_buffer_usedlength(*text); + CHECK(dns_ntatable_totext(ntatable, view->name, text)); } CHECK(putnull(text)); |