summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-01-16 13:28:24 -0800
committerJeremy Allison <jra@samba.org>2008-01-16 13:28:24 -0800
commit70426bdd307be2bbaa2ec6f111440bae69216933 (patch)
tree6484c9c1e57362071a3d029b02d132c522fafc71
parentbd8abea49fed09e131ab5162821b0ed05c1ab1b0 (diff)
downloadsamba-70426bdd307be2bbaa2ec6f111440bae69216933.tar.gz
samba-70426bdd307be2bbaa2ec6f111440bae69216933.tar.bz2
samba-70426bdd307be2bbaa2ec6f111440bae69216933.zip
Tidy up code and debug for non-default krb5 IPv6 port.
Jeremy. (This used to be commit 79b7972de4c2a8c71e37642ddf7e5bbed53dd58a)
-rw-r--r--source3/libads/kerberos.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index f7e947b1e7..b99525047f 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -689,25 +689,31 @@ static char *print_kdc_line(char *mem_ctx,
krb5 port with an address, as this requires a ':'.
Resolve to a name. */
char hostname[MAX_DNS_NAME_LENGTH];
- if (sys_getnameinfo((const struct sockaddr *)pss,
+ int ret = sys_getnameinfo((const struct sockaddr *)pss,
sizeof(*pss),
hostname, sizeof(hostname),
NULL, 0,
- NI_NAMEREQD) == 0) {
- /* Success, use host:port */
- kdc_str = talloc_asprintf(mem_ctx,
+ NI_NAMEREQD);
+ if (ret) {
+ DEBUG(0,("print_kdc_line: can't resolve name "
+ "for kdc with non-default port %s. "
+ "Error %s\n.",
+ print_canonical_sockaddr(mem_ctx, pss),
+ gai_strerror(ret)));
+ }
+ /* Success, use host:port */
+ kdc_str = talloc_asprintf(mem_ctx,
"%s\tkdc = %s:%u\n",
- prev_line,
+ prev_line,
hostname,
(unsigned int)port);
- return kdc_str;
- }
- }
- kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
+ } else {
+ kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
prev_line,
print_sockaddr(addr,
sizeof(addr),
pss));
+ }
}
return kdc_str;
}