aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2023-04-07 19:36:12 -0400
committerStephen Frost <sfrost@snowman.net>2023-04-07 19:36:12 -0400
commit1fdd1fbe10fe6f7f404238e586cac212ef1451c8 (patch)
tree642822be1ffb16461f87583beefd4217083dc9b2 /src
parent1bee3ca2384fc635029390cf37159cb04250c67e (diff)
downloadpostgresql-1fdd1fbe10fe6f7f404238e586cac212ef1451c8.tar.gz
postgresql-1fdd1fbe10fe6f7f404238e586cac212ef1451c8.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/test/kerberos/t/001_auth.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index 1b8ec8e4a19..497f60996d6 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -93,6 +93,17 @@ $stdout =~ m/Kerberos 5 release ([0-9]+\.[0-9]+)/
or BAIL_OUT("could not get Kerberos version");
$krb5_version = $1;
+# Build the krb5.conf to use.
+#
+# Explicitly specify the default (test) realm and the KDC for
+# that realm to avoid the Kerberos library trying to look up
+# that information in DNS, and also because we're using a
+# non-standard KDC port.
+#
+# Reverse DNS is explicitly disabled to avoid any issue with a
+# captive portal or other cases where the reverse DNS succeeds
+# and the Kerberos library uses that as the canonical name of
+# the host and then tries to acquire a cross-realm ticket.
append_to_file(
$krb5_conf,
qq![logging]
@@ -101,6 +112,7 @@ kdc = FILE:$kdc_log
[libdefaults]
default_realm = $realm
+rdns = false
[realms]
$realm = {