10000 For Kerberos testing, disable reverse DNS lookup · postgres/postgres@f0bd336 · GitHub
[go: up one dir, main page]

Skip to content

Commit f0bd336

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 83965ef commit f0bd336

File tree

Collapse 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
@@ -72,6 +72,17 @@
7272
or BAIL_OUT("could not get Kerberos version");
7373
$krb5_version = $1;
7474

75+
# Build the krb5.conf to use.
76+
#
77+
# Explicitly specify the default (test) realm and the KDC for
78+
# that realm to avoid the Kerberos library trying to look up
79+
# that information in DNS, and also because we're using a
80+
# non-standard KDC port.
81+
#
82+
# Reverse DNS is explicitly disabled to avoid any issue with a
83+
# captive portal or other cases where the reverse DNS succeeds
84+
# and the Kerberos library uses that as the canonical name of
85+
# the host and then tries to acquire a cross-realm ticket.
7586
append_to_file(
7687
$krb5_conf,
7788
qq![logging]
@@ -80,6 +91,7 @@
8091
8192
[libdefaults]
8293
default_realm = $realm
94+
rdns = false
8395
8496
[realms]
8597
$realm = {

0 commit comments

Comments
 (0)
0