summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-06-05 00:48:37 -0400
committerGreg Hudson <ghudson@mit.edu>2012-06-05 00:48:37 -0400
commit5cf17e31800e032ad76366f38d28b2797cd595cc (patch)
tree65b268aa9346087ae6d83eafcc72bd24e42c05c1 /src
parentcbfe4fd9cad2a63199b1eb62ea93f2e5c7678978 (diff)
downloadkrb5-5cf17e31800e032ad76366f38d28b2797cd595cc.tar.gz
krb5-5cf17e31800e032ad76366f38d28b2797cd595cc.tar.xz
krb5-5cf17e31800e032ad76366f38d28b2797cd595cc.zip
Fix k5test.py hostname canonicalization
r25844 (#7124) stopped using AI_ADDRCONFIG when canonicalizing hostnames in sn2princ. So we need to also stop using it in k5test.c's _get_hostname() or we could come up with a different result on a system where forward and reverse resolution via IPv4 and IPv6 produce different results. That in turn causes a t_gssapi.py test (the one using the un-canonicalized hostname) to fail, because libkrb5 looks for a different host principal than k5test.py put in the keytab.
Diffstat (limited to 'src')
-rw-r--r--src/util/k5test.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/util/k5test.py b/src/util/k5test.py
index 513b9c5163..5adfc95968 100644
--- a/src/util/k5test.py
+++ b/src/util/k5test.py
@@ -439,8 +439,7 @@ def _find_srctop():
def _get_hostname():
hostname = socket.gethostname()
try:
- ai = socket.getaddrinfo(hostname, None, 0, 0, 0,
- socket.AI_CANONNAME | socket.AI_ADDRCONFIG)
+ ai = socket.getaddrinfo(hostname, None, 0, 0, 0, socket.AI_CANONNAME)
except socket.gaierror, (error, errstr):
fail('Local hostname "%s" does not resolve: %s.' % (hostname, errstr))
(family, socktype, proto, canonname, sockaddr) = ai[0]