SHA256
3
0
forked from pool/glibc
glibc/glibc-nscd-hconf.diff
Petr Baudis c944b8437a - Fix missing hconf setup in nscd - this meant multi on in
/etc/host.conf was ignored when nscd was used, breaking e.g.
  resolving of multi-AF records in /etc/hosts [bnc#572188]
- Fix two LD_AUDIT security vulnerabilities: spurious $ORIGIN expansion
  and missing setuid library check when running as setuid [bnc#646960]

OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=42
2010-11-01 22:13:24 +00:00

36 lines
943 B
Diff

diff --git a/nscd/aicache.c b/nscd/aicache.c
index 3cb2208..2e92929 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -26,6 +26,7 @@
#include <time.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <resolv/res_hconf.h>
#include "dbg_log.h"
#include "nscd.h"
@@ -103,6 +104,8 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
if (__res_maybe_init (&_res, 0) == -1)
no_more = 1;
+ if (!_res_hconf.initialized)
+ _res_hconf_init ();
/* If we are looking for both IPv4 and IPv6 address we don't want
the lookup functions to automatically promote IPv4 addresses to
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index ed55bec..c79b85a 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -84,7 +84,9 @@ static const struct cmd
};
/* Structure containing the state. */
+#ifndef NOT_IN_libc
struct hconf _res_hconf;
+#endif
/* Skip white space. */
static const char *