From 7cecd26fbe678fb18af01ad0bc828d03125bb971 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 6 Jul 2026 16:08:05 +0000 Subject: Add checks with s6-tcpserver-access -p for nxdomain --- src/conn-tools/s6-tcpserver-access.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/conn-tools/s6-tcpserver-access.c b/src/conn-tools/s6-tcpserver-access.c index 04eabac..cd9d1e0 100644 --- a/src/conn-tools/s6-tcpserver-access.c +++ b/src/conn-tools/s6-tcpserver-access.c @@ -123,6 +123,7 @@ int main (int argc, char const *const *argv) } if (!argc) dieusage() ; if (!*argv[0]) dieusage() ; + if (flagparanoid) flagdnslookup = flagfatal = 1 ; proto = getenv("PROTO") ; if (!proto) strerr_dienotset(100, "PROTO") ; @@ -367,7 +368,7 @@ int main (int argc, char const *const *argv) r = ip46_is6(&remoteip) ? s6dns_resolve_aaaa_g(&data[1].ds, remotebuf, remotelen, 0, &deadline) : s6dns_resolve_a_g(&data[1].ds, remotebuf, remotelen, 0, &deadline) ; if (r <= 0) { - if (verbosity >= 3) strerr_warnwu4x("(paranoidly) resolve ", remotebuf, ": ", s6dns_constants_error_str(errno)) ; + if (verbosity >= 3) strerr_warnwu("(paranoidly) resolve ", remotebuf, ": ", s6dns_constants_error_str(errno)) ; if (flagfatal) { e = errno == ETIMEDOUT ? 99 : errno == ENOENT ? 1 : 111 ; @@ -385,6 +386,15 @@ int main (int argc, char const *const *argv) } stralloc_free(&data[1].ds) ; } + else if (!remotelen && flagparanoid) + { + if (verbosity >= 3) strerr_warnwu("(paranoidly) resolve PTR for client address", ": ", s6dns_constants_error_str(blob[1].status)) ; + if (flagfatal) + { + e = errno == ETIMEDOUT ? 99 : errno == ENOENT ? 1 : 111 ; + goto reject ; + } + } } if (!env_addmodif(&modifs, tcpremotehost, remotelen ? remotebuf : 0)) dienomem() ; -- cgit v1.3.1