--- src/lib/krb5/os/locate_kdc.c.orig Wed Feb 20 23:23:14 2002 +++ src/lib/krb5/os/locate_kdc.c Wed Feb 20 23:24:41 2002 @@ -812,6 +812,35 @@ { int udpport, sec_udpport; +#if 1 + /* this is a quick hack to avoid DNS problem - Samba always knows the KDC IP + before this code is called, so we might as well use it! */ + char *p, *env; + struct addrlist al = ADDRLIST_INIT; + + *addrlist = al; + + asprintf(&env, "KRB5_KDC_ADDRESS_%*.*s", realm->length, realm->length, realm->data); + if ((p=getenv(env))) { + struct in_addr addr; + if (inet_pton(AF_INET, p, &addr) > 0) { + struct sockaddr_in *sin_p = malloc(sizeof(struct sockaddr)); + if (sin_p) { + sin_p->sin_family = AF_INET; + sin_p->sin_port = htons(KRB5_DEFAULT_PORT); + memcpy(&sin_p->sin_addr,&addr,sizeof(addr)); + add_sockaddr_to_list(addrlist, + (struct sockaddr *)sin_p, + sizeof(struct sockaddr_in)); + free(sin_p); + free(env); + return 0; + } + } + } + free(env); +#endif + udpport = get_port (KDC_PORTNAME, 0, KRB5_DEFAULT_PORT); sec_udpport = get_port (KDC_SECONDARY_PORTNAME, 0, (udpport == htons (KRB5_DEFAULT_PORT)