Skip to content

configure.ac: configure script does not detect res_ninit and res_ndestroy correctly if resolv.h requires some other header files #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
futatuki opened this issue Mar 9, 2024 · 3 comments

Comments

@futatuki
Copy link

futatuki commented Mar 9, 2024

Although the configure.ac checks the header files needed by resolv.h check functions for res_ninit and res_ndestroy does not include them before use resolv.h

This can cause some errors in configure script like issue #203 in trusteddomainproject/OpenDKIM.

With glibc, resolv.h itself contains all declarations for the function, so it is not affected. However in all other platform which requires some other headers for using resolv.h but has res_ninit() and/or res_ndestroy function, the check would be failed.

futatuki added a commit to futatuki/OpenDMARC that referenced this issue Mar 9, 2024
Adadov pushed a commit to Adadov/OpenDMARC that referenced this issue Jun 18, 2024
…s required by resolv.h

before use it

(cherry picked from commit f946ec9)
@thegushi
Copy link
Collaborator

thegushi commented May 5, 2025

I don't know how this would play on BSD (where it's primarily clang compiler) or under weird OSes that use the MUSL support, so I need to QA this a bit and make sure that this fix doesn't make things worse on one of the other platforms.

@futatuki
Copy link
Author

futatuki commented May 5, 2025

Another point of view, configure.ac uses AC_HEADER_RESOLV[1], which checks header files need to include before using resolv.h. So all the tests using resolv.h in configure should also use those include files, for consistensy.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Particular-Headers.html

@futatuki
Copy link
Author

futatuki commented May 5, 2025

Note: on FreeBSD it is no longer affected since 13.2/14.1 releases, because of those commits for the respection of portabirity from Linux and NetBSD:

freebsd/freebsd-src@4487c62
freebsd/freebsd-src@5a70219
freebsd/freebsd-src@58cf91d

This resolv.h originally came from isc-bind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants