Skip to content

Commit 1fdd1fb

Browse files
committed
For Kerberos testing, disable reverse DNS lookup
In our Kerberos test suite, there isn't much need to worry about the normal canonicalization that Kerberos provides by looking up the reverse DNS for the IP address connected to, and in some cases it can actively cause problems (eg: a captive portal wifi where the normally not resolvable localhost address used ends up being resolved anyway, and not to the domain we are using for testing, causing the entire regression test to fail with errors about not being able to get a TGT for the remote realm for cross-realm trust). Therefore, disable it by adding rdns = false into the krb5.conf that's generated for the test. Reviewed-By: Heikki Linnakangas Discussion: https://postgr.es/m/Y/QD2zDkDYQA1GQt@tamriel.snowman.net
1 parent 1bee3ca commit 1fdd1fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/kerberos/t/001_auth.pl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@
9393
or BAIL_OUT("could not get Kerberos version");
9494
$krb5_version = $1;
9595

96+
# Build the krb5.conf to use.
97+
#
98+
# Explicitly specify the default (test) realm and the KDC for
99+
# that realm to avoid the Kerberos library trying to look up
100+
# that information in DNS, and also because we're using a
101+
# non-standard KDC port.
102+
#
103+
# Reverse DNS is explicitly disabled to avoid any issue with a
104+
# captive portal or other cases where the reverse DNS succeeds
105+
# and the Kerberos library uses that as the canonical name of
106+
# the host and then tries to acquire a cross-realm ticket.
96107
append_to_file(
97108
$krb5_conf,
98109
qq![logging]
@@ -101,6 +112,7 @@
101112
102113
[libdefaults]
103114
default_realm = $realm
115+
rdns = false
104116
105117
[realms]
106118
$realm = {

0 commit comments

Comments
 (0)