Taylor R Campbell ad23636db8 Add a test for potential DNS leaks via symbol interposition.
We build variants of kinit and test_acquire_cred that define their
own symbols rk_dns_lookup, gethostbyname, gethostbyname2, and
getaddrinfo to print a message and abort.  For getaddrinfo, we abort
only if the caller failed to specify AI_NUMERICHOST; otherwise we use
dlsym(RTLD_NEXT, "getaddrinfo") instead.

The new test tests/gss/check-nodns is like tests/gss/check-basic, but
uses kinit_auditdns and test_acquire_cred_auditdns to verify that no
DNS resolution happens.

This test should work and be effective on ELF platforms where the
getaddrinfo function is implemented by the symbol `getaddrinfo'.  On
non-ELF platforms it may not be effective -- and on platforms where
the getaddrinfo function is implemented by another symbol (like
`__getaddrinfo50') it may not work, but we can cross that bridge when
we come to it.

Verified manually that the test fails, with the expected error
message and abort, without `block_dns = yes' in krb5-nodns.conf.  No
automatic test of the mechanism for now because it might not work on
some platforms.

XXX check-nodns.in is copypasta of check-basic.in, should factor out
the common parts so they don't get out of sync.
2024-01-08 10:22:02 -06:00
..
2012-03-06 00:06:26 -08:00
2011-05-21 11:57:31 -07:00
2011-05-21 11:57:31 -07:00
2015-05-26 16:03:00 +02:00
2014-08-22 20:57:24 -07:00
2022-01-14 17:59:49 -06:00
2017-03-13 18:39:41 -04:00
2022-01-24 13:51:43 -06:00
2019-10-09 20:53:30 -05:00
2022-10-03 09:44:22 -05:00
2014-01-31 08:38:04 +01:00
2022-01-14 17:59:49 -06:00
2011-05-21 11:57:31 -07:00
2020-05-26 11:48:45 -05:00