nslookup issues

Casey Deccio casey at deccio.net
Tue Sep 13 23:06:10 UTC 2022


> On Sep 13, 2022, at 3:35 PM, Graham Clinch <g.clinch at lancaster.ac.uk> wrote:
> 
> I suspect nrpe-ng is closing stdin before launching nslookup.
> 
> 
> With mac homebrew's build of bind 9.18.6 and a bit of shell redirection to close stdin, I get:
> 
> ---
> $ /opt/homebrew/bin/nslookup -version
> nslookup 9.18.6
> 
> $ /opt/homebrew/bin/nslookup example.net 0<&-
> [... usual output snipped ...]
> 
> Assertion failed: (fd > STDERR_FILENO), function uv__close, file core.c, line 602.
> Abort trap: 6
> 
> $ echo $?
> 134
> ---
> 

Nice find!!

> This might count as a regression of sorts from the migration to libuv, as older nslookup doesn't fail in the same way:

Could be.  At the very least it's a behavioral difference, which affects some packages that depend on it.  I'll leave it to the BIND devs to determine if/how to handle it.

> (dig & delv are also affected in the same way)
> 
> The cmake group came across the same situation with libuv and open missing standard fds against /dev/null to compensate:
> https://gitlab.kitware.com/cmake/cmake/-/merge_requests/3282

I've patched the code for nrpe_ng, and it works!

$ diff -u /usr/lib/python3/dist-packages/nrpe_ng/commands.py{.old,}
--- /usr/lib/python3/dist-packages/nrpe_ng/commands.py.old	2017-08-08 13:05:02.000000000 -0600
+++ /usr/lib/python3/dist-packages/nrpe_ng/commands.py	2022-09-13 17:00:36.767239885 -0600
@@ -85,6 +85,7 @@
 
         proc = tornado.process.Subprocess(
             run_args,
+            stdin=subprocess.DEVNULL,
             stdout=tornado.process.Subprocess.STREAM,
             close_fds=True,
             env=env)

I'll request that something get pushed upstream.  Many thanks for help tracking that down!

Casey


More information about the bind-users mailing list