Don't assume that presence of res_nsearch() means we have ns_initparse()
authorTom Yu <tlyu@mit.edu>
Tue, 21 Sep 2004 22:42:31 +0000 (22:42 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 21 Sep 2004 22:42:31 +0000 (22:42 +0000)
ticket: 2710

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16773 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4
src/lib/krb5/os/ChangeLog
src/lib/krb5/os/dnsglue.c

index 54a49cb659a41e88116030d7ae44d60de8a6e784..8dc33ca4dd7b0a4c471516380ccc2c88b8f2a40d 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-21  Tom Yu  <tlyu@mit.edu>
+
+       * alcocal.m4 (AC_LIBRARY_NET): Additionally, check ns_initparse,
+       since Linux prototypes it but doesn't export it.
+
 2004-09-21  Tom Yu  <tlyu@mit.edu>
 
        * aclocal.m4 (KRB5_AC_NEED_BIND_8_COMPAT): Remove.
index c3acf0b5551d163f20fe2f1e0a9690193410f0b9..87c071d23d82938b239527924c4e7e985e06700e 100644 (file)
@@ -1360,7 +1360,8 @@ AC_DEFUN(AC_LIBRARY_NET, [
     # We assume that if libresolv exists we can link against it.
     # This may get us a gethostby* that doesn't respect nsswitch.
     AC_CHECK_LIB(resolv, main)
-_KRB5_AC_CHECK_RES_FUNCS(res_nsearch res_search ns_name_uncompress dn_skipname)
+_KRB5_AC_CHECK_RES_FUNCS(res_nsearch res_search ns_initparse dnl
+ns_name_uncompress dn_skipname)
     if test $krb5_cv_func_res_nsearch = no \
       && test $krb5_cv_func_res_search = no; then
        # Attempt to link with res_search(), in case it's not prototyped.
index 903bf58fcded36fd37def305b4eb5abfbfc96f48..85358f418b31be349c57f8af39e9ce5f9debf9f1 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-21  Tom Yu  <tlyu@mit.edu>
+
+       * dnsglue.c: Conditionalize some stuff on ns_initparse() instead
+       of assuming that the presence of res_nsearch() means
+       ns_initparse() is available.
+
 2004-09-20  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in (STLIBOBJS, OBJS, SRCS): Add dnsglue.c.
index 352134b9cc6f3100429ddacc743f5de0174c8cdc..4bf5e0ac67479e069aa872bef73d204b05c07458 100644 (file)
@@ -37,7 +37,7 @@ struct krb5int_dns_state {
     void *ansp;
     int anslen;
     int ansmax;
-#if HAVE_RES_NSEARCH
+#if HAVE_NS_INITPARSE
     int cur_ans;
     ns_msg msg;
 #else
@@ -46,7 +46,7 @@ struct krb5int_dns_state {
 #endif
 };
 
-#if !HAVE_RES_NSEARCH
+#if !HAVE_NS_INITPARSE
 static int initparse(struct krb5int_dns_state *);
 #endif
 
@@ -81,8 +81,11 @@ krb5int_dns_init(struct krb5int_dns_state **dsp,
     nextincr = 2048;
     maxincr = INT_MAX;
 
-#if HAVE_RES_NSEARCH
+#if HAVE_NS_INITPARSE
     ds->cur_ans = 0;
+#endif
+
+#if HAVE_RES_NSEARCH
     len = res_ninit(&statbuf);
     if (len < 0)
        return -1;
@@ -117,7 +120,7 @@ krb5int_dns_init(struct krb5int_dns_state **dsp,
     } while (len > ds->ansmax);
 
     ds->anslen = len;
-#if HAVE_RES_NSEARCH
+#if HAVE_NS_INITPARSE
     len = ns_initparse(ds->ansp, ds->anslen, &ds->msg);
 #else
     len = initparse(ds);
@@ -130,7 +133,7 @@ krb5int_dns_init(struct krb5int_dns_state **dsp,
     return 0;
 }
 
-#if HAVE_RES_NSEARCH
+#if HAVE_NS_INITPARSE
 /*
  * krb5int_dns_nextans - get next matching answer record
  *
@@ -196,7 +199,7 @@ krb5int_dns_fini(struct krb5int_dns_state *ds)
 /*
  * Compat routines for BIND 4
  */
-#if !HAVE_RES_NSEARCH
+#if !HAVE_NS_INITPARSE
 
 /*
  * initparse