diff options
author | Günther Deschner <gd@samba.org> | 2010-05-15 00:34:35 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-01-13 17:58:49 +0100 |
commit | 81f4c22bc4225e098541787de6b714a1bb2ef63b (patch) | |
tree | 0373b80f5cf6e8aa40fd39e6ebbe04d14ec84531 /source3 | |
parent | 80ad2c9bdf4324b58439a5801a0accec7064dd88 (diff) | |
download | samba-81f4c22bc4225e098541787de6b714a1bb2ef63b.tar.gz |
s3-kerberos: temporary fix for ipv6 in print_kdc_line().
Currently no krb5 lib supports "kdc = ipv6 address" at all, so for now just fill
in just the kdc_name if we have it and let the krb5 lib figure out the
appropriate ipv6 address
ipv6 gurus, please check.
Guenther
(cherry picked from commit dd5a4e23f8c24564d3fd21bb8d01172321087362)
The last 3 patches fix bug #7341 (winbind not working over IPv6).
(cherry picked from commit 22de0639efe63def87e32e5c18a82ea56c2984ef)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libads/kerberos.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 262be85aa37..aa3a76bf2ac 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -676,6 +676,9 @@ static char *print_kdc_line(char *mem_ctx, char addr[INET6_ADDRSTRLEN]; uint16_t port = get_sockaddr_port(pss); + DEBUG(10,("print_kdc_line: IPv6 case for kdc_name: %s, port: %d\n", + kdc_name, port)); + if (port != 0 && port != DEFAULT_KRB5_PORT) { /* Currently for IPv6 we can't specify a non-default krb5 port with an address, as this requires a ':'. @@ -692,6 +695,7 @@ static char *print_kdc_line(char *mem_ctx, "Error %s\n.", print_canonical_sockaddr(mem_ctx, pss), gai_strerror(ret))); + return NULL; } /* Success, use host:port */ kdc_str = talloc_asprintf(mem_ctx, @@ -700,11 +704,22 @@ static char *print_kdc_line(char *mem_ctx, hostname, (unsigned int)port); } else { - kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", - prev_line, - print_sockaddr(addr, - sizeof(addr), - pss)); + + /* no krb5 lib currently supports "kdc = ipv6 address" + * at all, so just fill in just the kdc_name if we have + * it and let the krb5 lib figure out the appropriate + * ipv6 address - gd */ + + if (kdc_name) { + kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", + prev_line, kdc_name); + } else { + kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", + prev_line, + print_sockaddr(addr, + sizeof(addr), + pss)); + } } } return kdc_str; |