diff options
author | Günther Deschner <gd@samba.org> | 2010-05-15 00:34:35 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-05-17 13:18:11 +0200 |
commit | dd5a4e23f8c24564d3fd21bb8d01172321087362 (patch) | |
tree | 84e72647de31a1762f4eb38b05a35b99d7dad3a6 | |
parent | e3bdff3d67b46277ee59685218bd90f3788b487d (diff) | |
download | samba-dd5a4e23f8c24564d3fd21bb8d01172321087362.tar.gz samba-dd5a4e23f8c24564d3fd21bb8d01172321087362.tar.bz2 samba-dd5a4e23f8c24564d3fd21bb8d01172321087362.zip |
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
-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 01a88e8d34..df0ec8e8c3 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -728,6 +728,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 ':'. @@ -744,6 +747,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, @@ -752,11 +756,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; |