diff -u ./source3/libads/dns.c.orig ./source3/libads/dns.c --- ./source3/libads/dns.c.orig 2010-05-17 06:51:23.000000000 -0500 +++ ./source3/libads/dns.c 2010-05-30 13:07:12.000000000 -0500 @@ -87,7 +87,11 @@ /* See RFC 1035 for details. If this fails, then return. */ +#ifdef HAVE_DN_EXPAND namelen = dn_expand( start, end, p, hostname, sizeof(hostname) ); +#else + namelen = -1; /* TODO!!! */ +#endif if ( namelen < 0 ) { return False; } @@ -124,7 +128,11 @@ ZERO_STRUCTP( rr ); /* pull the name from the answer */ +#ifdef HAVE_DN_EXPAND namelen = dn_expand( start, end, p, hostname, sizeof(hostname) ); +#else + namelen = -1; /* TODO!!! */ +#endif if ( namelen < 0 ) { return -1; } @@ -198,7 +206,11 @@ p += 6; +#ifdef HAVE_DN_EXPAND namelen = dn_expand( start, end, p, dcname, sizeof(dcname) ); +#else + namelen = -1; /* TODO!!! */ +#endif if ( namelen < 0 ) { DEBUG(1,("ads_dns_parse_rr_srv: Failed to uncompress name!\n")); return False; @@ -247,7 +259,11 @@ /* ame server hostname */ +#ifdef HAVE_DN_EXPAND namelen = dn_expand( start, end, p, nsname, sizeof(nsname) ); +#else + namelen = -1; /* TODO!!! */ +#endif if ( namelen < 0 ) { DEBUG(1,("ads_dns_parse_rr_ns: Failed to uncompress name!\n")); return False; @@ -336,6 +352,7 @@ } } +#ifdef HAVE_RES_QUERY /* or #ifdef HAVE_DN_EXPANS? */ if ((resp_len = res_query(name, C_IN, q_type, buffer, buf_len)) < 0 ) { DEBUG(3,("ads_dns_lookup_srv: " @@ -353,6 +370,15 @@ last_dns_check = time(NULL); return last_dns_status; } +#else /* TODO!!! */ + DEBUG(3,("ads_dns_lookup_srv: " + "Failed to resolve %s (%s)\n", + name, strerror(ENOTSUP))); + TALLOC_FREE( buffer ); + last_dns_status = NT_STATUS_UNSUCCESSFUL; + last_dns_check = time(NULL); + return last_dns_status; +#endif /* On AIX, Solaris, and possibly some older glibc systems (e.g. SLES8) truncated replies never give back a resp_len > buflen