00db10
commit 595aba70a4c676f7efaf6a012f54cd22aa189c5b
00db10
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
00db10
Date:   Mon Aug 26 15:42:29 2013 +0530
00db10
00db10
    Initialize res_hconf in nscd
00db10
    
00db10
    Fixes BZ #15890.
00db10
00db10
diff -pruN glibc-2.17-c758a686/nscd/aicache.c glibc-2.17-c758a686/nscd/aicache.c
00db10
--- glibc-2.17-c758a686/nscd/aicache.c	2013-08-11 04:22:55.000000000 +0530
00db10
+++ glibc-2.17-c758a686/nscd/aicache.c	2013-08-26 11:10:25.843470413 +0530
00db10
@@ -25,6 +25,7 @@
00db10
 #include <time.h>
00db10
 #include <unistd.h>
00db10
 #include <sys/mman.h>
00db10
+#include <resolv/res_hconf.h>
00db10
 
00db10
 #include "dbg_log.h"
00db10
 #include "nscd.h"
00db10
@@ -100,8 +101,11 @@ addhstaiX (struct database_dyn *db, int
00db10
     no_more = __nss_database_lookup ("hosts", NULL,
00db10
 				     "dns [!UNAVAIL=return] files", &nip;;
00db10
 
00db10
+  /* Initialize configurations.  */
00db10
+  if (__builtin_expect (!_res_hconf.initialized, 0))
00db10
+    _res_hconf_init ();
00db10
   if (__res_maybe_init (&_res, 0) == -1)
00db10
-	    no_more = 1;
00db10
+    no_more = 1;
00db10
 
00db10
   /* If we are looking for both IPv4 and IPv6 address we don't want
00db10
      the lookup functions to automatically promote IPv4 addresses to