forked from pool/glibc
Accepting request 127122 from home:a_jaeger:my-factory-packages
Fix two bugs in name resolving. OBS-URL: https://build.opensuse.org/request/show/127122 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=200
This commit is contained in:
parent
2f3b93f741
commit
c4fbe94a75
@ -1,10 +1,8 @@
|
||||
References: bnc#361697
|
||||
|
||||
Index: glibc-2.15/sysdeps/posix/getaddrinfo.c
|
||||
===================================================================
|
||||
--- glibc-2.15.orig/sysdeps/posix/getaddrinfo.c
|
||||
+++ glibc-2.15/sysdeps/posix/getaddrinfo.c
|
||||
@@ -269,7 +269,7 @@ extern service_user *__nss_hosts_databas
|
||||
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
|
||||
index 1a023f9..c8af8b9 100644
|
||||
--- a/sysdeps/posix/getaddrinfo.c
|
||||
+++ b/sysdeps/posix/getaddrinfo.c
|
||||
@@ -269,7 +269,7 @@ extern service_user *__nss_hosts_database attribute_hidden;
|
||||
static int
|
||||
gaih_inet (const char *name, const struct gaih_service *service,
|
||||
const struct addrinfo *req, struct addrinfo **pai,
|
||||
@ -13,7 +11,7 @@ Index: glibc-2.15/sysdeps/posix/getaddrinfo.c
|
||||
{
|
||||
const struct gaih_typeproto *tp = gaih_inet_typeproto;
|
||||
struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
|
||||
@@ -832,7 +832,10 @@ gaih_inet (const char *name, const struc
|
||||
@@ -832,7 +832,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||
no_data = 0;
|
||||
nss_gethostbyname4_r fct4
|
||||
= __nss_lookup_function (nip, "gethostbyname4_r");
|
||||
@ -25,7 +23,7 @@ Index: glibc-2.15/sysdeps/posix/getaddrinfo.c
|
||||
{
|
||||
int herrno;
|
||||
|
||||
@@ -935,7 +938,7 @@ gaih_inet (const char *name, const struc
|
||||
@@ -935,7 +938,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||
if (fct != NULL)
|
||||
{
|
||||
if (req->ai_family == AF_INET6
|
||||
@ -34,11 +32,15 @@ Index: glibc-2.15/sysdeps/posix/getaddrinfo.c
|
||||
{
|
||||
gethosts (AF_INET6, struct in6_addr);
|
||||
no_inet6_data = no_data;
|
||||
@@ -2418,7 +2421,7 @@ getaddrinfo (const char *name, const cha
|
||||
@@ -2418,7 +2421,11 @@ getaddrinfo (const char *name, const char *service,
|
||||
if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET
|
||||
|| hints->ai_family == AF_INET6)
|
||||
{
|
||||
- last_i = gaih_inet (name, pservice, hints, end, &naddrs);
|
||||
+ if (!check_pf_called)
|
||||
+ __check_pf (&seen_ipv4, &seen_ipv6, &in6ai, &in6ailen);
|
||||
+ check_pf_called = true;
|
||||
+
|
||||
+ last_i = gaih_inet (name, pservice, hints, end, &naddrs, seen_ipv6);
|
||||
if (last_i != 0)
|
||||
{
|
||||
|
77
glibc-2.16-getaddrinfo-buffer.patch
Normal file
77
glibc-2.16-getaddrinfo-buffer.patch
Normal file
@ -0,0 +1,77 @@
|
||||
2012-07-02 Jeroen van Bemmel <jvb127@gmail.com>
|
||||
|
||||
[BZ #14307]
|
||||
[BZ #13904]
|
||||
* sysdeps/posix/getaddrinfo.c ( gaih_inet ): Increase the size of
|
||||
the temporary buffer used to invoke __gethostbyname2_r,
|
||||
__gethostbyaddr_r and gethostbyname4_r to make room for struct
|
||||
host_data / struct gaih_addrtuple.
|
||||
* resolv/nss_dns/dns-host.c (global scope): Move definition of
|
||||
implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS to
|
||||
header file nss/nsswitch.h.
|
||||
* nss/nsswitch.h (global scope): Add definition of implementation
|
||||
constants MAX_NR_ALIASES and MAX_NR_ADDRS (moved from
|
||||
resolv/nss_dns/dns-host.c).
|
||||
|
||||
diff --git glibc/nss/nsswitch.h glibc/nss/nsswitch.h
|
||||
index 90e208b..8965819 100644
|
||||
--- glibc/nss/nsswitch.h
|
||||
+++ glibc/nss/nsswitch.h
|
||||
@@ -198,4 +198,8 @@ extern int __nss_hostname_digits_dots (const char *name,
|
||||
int *h_errnop);
|
||||
libc_hidden_proto (__nss_hostname_digits_dots)
|
||||
|
||||
+/* Maximum number of aliases we allow. */
|
||||
+#define MAX_NR_ALIASES 48
|
||||
+#define MAX_NR_ADDRS 48
|
||||
+
|
||||
#endif /* nsswitch.h */
|
||||
diff --git glibc/resolv/nss_dns/dns-host.c glibc/resolv/nss_dns/dns-host.c
|
||||
index a924d40..6b62c05 100644
|
||||
--- glibc/resolv/nss_dns/dns-host.c
|
||||
+++ glibc/resolv/nss_dns/dns-host.c
|
||||
@@ -88,10 +88,6 @@
|
||||
|
||||
#define RESOLVSORT
|
||||
|
||||
-/* Maximum number of aliases we allow. */
|
||||
-#define MAX_NR_ALIASES 48
|
||||
-#define MAX_NR_ADDRS 48
|
||||
-
|
||||
#if PACKETSZ > 65536
|
||||
# define MAXPACKET PACKETSZ
|
||||
#else
|
||||
diff --git glibc/sysdeps/posix/getaddrinfo.c glibc/sysdeps/posix/getaddrinfo.c
|
||||
index 2eca2ae..efb0423 100644
|
||||
--- glibc/sysdeps/posix/getaddrinfo.c
|
||||
+++ glibc/sysdeps/posix/getaddrinfo.c
|
||||
@@ -568,7 +568,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||
IPv6 scope ids. */
|
||||
if (req->ai_family == AF_INET)
|
||||
{
|
||||
- size_t tmpbuflen = 512;
|
||||
+ /* Allocate additional room for struct host_data in getanswer_r */
|
||||
+ size_t tmpbuflen = 512 + MAX_NR_ALIASES * sizeof(char*) + 16 * sizeof(char);
|
||||
assert (tmpbuf == NULL);
|
||||
tmpbuf = alloca_account (tmpbuflen, alloca_used);
|
||||
int rc;
|
||||
@@ -811,7 +812,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||
old_res_options = _res.options;
|
||||
_res.options &= ~RES_USE_INET6;
|
||||
|
||||
- size_t tmpbuflen = 1024;
|
||||
+ size_t tmpbuflen = 1024 + sizeof(struct gaih_addrtuple);
|
||||
malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen);
|
||||
assert (tmpbuf == NULL);
|
||||
if (!malloc_tmpbuf)
|
||||
@@ -1113,7 +1114,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
|
||||
struct hostent *h = NULL;
|
||||
int herrno;
|
||||
struct hostent th;
|
||||
- size_t tmpbuf2len = 512;
|
||||
+ /* Add room for struct host_data in resolv/nss_dns/dns-host.c */
|
||||
+ size_t tmpbuf2len = 512 + (MAX_NR_ALIASES+MAX_NR_ADDRS+1)*sizeof(char*)
|
||||
+ + 16 * sizeof(char);
|
||||
|
||||
do
|
||||
{
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 4 13:36:17 UTC 2012 - aj@suse.de
|
||||
|
||||
- Add glibc-2.16-getaddrinfo-buffer.patch to not use a too small
|
||||
buffer for dns queries on 64-bit systems (bso#14307,bso#13904).
|
||||
- Fix getaddrinfo-ipv6-sanity.diff (bnc#767125).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 2 16:23:15 UTC 2012 - agraf@suse.com
|
||||
|
||||
|
@ -290,6 +290,8 @@ Patch1018: glibc-2.16-mcheck.patch
|
||||
Patch1019: tr_TR.patch
|
||||
# PATCH-FIX-UPSTREAM implement *context on ARM - agraf@suse.de
|
||||
Patch1020: glibc-2.16-arm-context.patch
|
||||
# PATCH-FIX-UPSTREAM Fix dns buffer - aj@suse.de
|
||||
Patch1021: glibc-2.16-getaddrinfo-buffer.patch
|
||||
|
||||
###
|
||||
# Patches awaiting upstream approval
|
||||
@ -564,6 +566,7 @@ rm nscd/s-stamp
|
||||
%patch1018 -p1
|
||||
%patch1019 -p1
|
||||
%patch1020 -p1
|
||||
%patch1021 -p1
|
||||
|
||||
%patch2001 -p1
|
||||
%patch2004 -p1
|
||||
|
Loading…
Reference in New Issue
Block a user