summaryrefslogtreecommitdiffstats
path: root/bin/named
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 16:41:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 16:41:29 +0000
commite2fc8e037ea6bb5de92b25ec9c12a624737ac5ca (patch)
tree65e6bbf5e12c3fe09b43e577f8d1786d06bcd559 /bin/named
parentReleasing progress-linux version 1:9.18.19-1~deb12u1progress7u1. (diff)
downloadbind9-e2fc8e037ea6bb5de92b25ec9c12a624737ac5ca.tar.xz
bind9-e2fc8e037ea6bb5de92b25ec9c12a624737ac5ca.zip
Merging upstream version 1:9.18.24.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/named')
-rw-r--r--bin/named/Makefile.in2
-rw-r--r--bin/named/config.c4
-rw-r--r--bin/named/os.c21
-rw-r--r--bin/named/server.c40
4 files changed, 34 insertions, 33 deletions
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
index a38ce3b..2b60a43 100644
--- a/bin/named/Makefile.in
+++ b/bin/named/Makefile.in
@@ -125,11 +125,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/ax_gcc_func_attribute.m4 \
$(top_srcdir)/m4/ax_jemalloc.m4 \
$(top_srcdir)/m4/ax_lib_lmdb.m4 \
- $(top_srcdir)/m4/ax_perl_module.m4 \
$(top_srcdir)/m4/ax_posix_shell.m4 \
$(top_srcdir)/m4/ax_prog_cc_for_build.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \
- $(top_srcdir)/m4/ax_python_module.m4 \
$(top_srcdir)/m4/ax_restore_flags.m4 \
$(top_srcdir)/m4/ax_save_flags.m4 $(top_srcdir)/m4/ax_tls.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
diff --git a/bin/named/config.c b/bin/named/config.c
index 7f318a2..f95e433 100644
--- a/bin/named/config.c
+++ b/bin/named/config.c
@@ -337,14 +337,14 @@ dnssec-policy \"insecure\" {\n\
"# END TRUST ANCHORS\n\
\n\
primaries " DEFAULT_IANA_ROOT_ZONE_PRIMARIES " {\n\
- 2001:500:200::b; # b.root-servers.net\n\
+ 2801:1b8:10::b; # b.root-servers.net\n\
2001:500:2::c; # c.root-servers.net\n\
2001:500:2f::f; # f.root-servers.net\n\
2001:500:12::d0d; # g.root-servers.net\n\
2001:7fd::1; # k.root-servers.net\n\
2620:0:2830:202::132; # xfr.cjr.dns.icann.org\n\
2620:0:2d0:202::132; # xfr.lax.dns.icann.org\n\
- 199.9.14.201; # b.root-servers.net\n\
+ 170.247.170.2; # b.root-servers.net\n\
192.33.4.12; # c.root-servers.net\n\
192.5.5.241; # f.root-servers.net\n\
192.112.36.4; # g.root-servers.net\n\
diff --git a/bin/named/os.c b/bin/named/os.c
index 7af4729..0222abb 100644
--- a/bin/named/os.c
+++ b/bin/named/os.c
@@ -552,17 +552,19 @@ cleanup_pidfile(void) {
}
static void
-cleanup_lockfile(void) {
+cleanup_lockfile(bool unlink_lockfile) {
if (singletonfd != -1) {
close(singletonfd);
singletonfd = -1;
}
if (lockfile != NULL) {
- int n = unlink(lockfile);
- if (n == -1 && errno != ENOENT) {
- named_main_earlywarning("unlink '%s': failed",
- lockfile);
+ if (unlink_lockfile) {
+ int n = unlink(lockfile);
+ if (n == -1 && errno != ENOENT) {
+ named_main_earlywarning("unlink '%s': failed",
+ lockfile);
+ }
}
free(lockfile);
lockfile = NULL;
@@ -830,7 +832,7 @@ named_os_issingleton(const char *filename) {
if (ret == -1) {
named_main_earlywarning("couldn't create '%s'",
filename);
- cleanup_lockfile();
+ cleanup_lockfile(false);
return (false);
}
}
@@ -842,7 +844,7 @@ named_os_issingleton(const char *filename) {
singletonfd = open(filename, O_WRONLY | O_CREAT,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (singletonfd == -1) {
- cleanup_lockfile();
+ cleanup_lockfile(false);
return (false);
}
@@ -854,8 +856,7 @@ named_os_issingleton(const char *filename) {
/* Non-blocking (does not wait for lock) */
if (fcntl(singletonfd, F_SETLK, &lock) == -1) {
- close(singletonfd);
- singletonfd = -1;
+ cleanup_lockfile(false);
return (false);
}
@@ -866,7 +867,7 @@ void
named_os_shutdown(void) {
closelog();
cleanup_pidfile();
- cleanup_lockfile();
+ cleanup_lockfile(true);
}
void
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));