ub_ctx_debugout() and closing FDs

Felipe Gasper felipe at felipegasper.com
Mon Nov 29 15:18:30 UTC 2021


Hi all,

	I don’t see behaviour in this regard documented, so I wanted to clarify whether what I’m seeing is the intent:

- If I set the debug-out to some file descriptor greater than 2, ub_ctx_delete() will close that file descriptor.

- If I set debug-out to 0, 1, or 2, ub_ctx_delete() will NOT close the file descriptor.

- If I set debug-out to a >2 FD, then set it to 0, 1, or 2, ub_ctx_debugout() will NOT close the >2 file descriptor. (Nor, of course, will ub_ctx_delete().)

I recently fixes a file-descriptor leak in Perl DNS::Unbound and want to ensure that I’ve got things correct now.

Thank you!

Cheers,
-Felipe Gasper


More information about the Unbound-users mailing list