Rediff patch

This commit is contained in:
Denis Silakov 2016-02-19 16:38:40 +03:00
parent ebc136a5a8
commit 1b06f41956

View file

@ -1,28 +1,7 @@
commit d5dd6189d506068ed11c8bfa1e1e9bffde04decd
Author: Andreas Schwab <schwab@suse.de>
Date: Mon Jan 21 17:41:28 2013 +0100
Fix parsing of numeric hosts in gethostbyname_r
diff --git glibc-2.17-c758a686/nss/Makefile glibc-2.17-c758a686/nss/Makefile
index 449a258..553eafa 100644
--- glibc-2.17-c758a686/nss/Makefile
+++ glibc-2.17-c758a686/nss/Makefile
@@ -37,7 +37,8 @@ install-bin := getent makedb
makedb-modules = xmalloc hash-string
extra-objs += $(makedb-modules:=.o)
-tests = test-netdb tst-nss-test1 bug17079 tst-nss-getpwent
+tests = test-netdb tst-nss-test1 bug17079 tst-nss-getpwent \
+ test-digits-dots
xtests = bug-erange
include ../Makeconfig
diff --git glibc-2.17-c758a686/nss/digits_dots.c glibc-2.17-c758a686/nss/digits_dots.c
index 2b86295..e007ef4 100644
--- glibc-2.17-c758a686/nss/digits_dots.c
+++ glibc-2.17-c758a686/nss/digits_dots.c
@@ -46,7 +46,10 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
diff -Naur glibc-2.15-a316c1f.orig/nss/digits_dots.c glibc-2.15-a316c1f/nss/digits_dots.c
--- glibc-2.15-a316c1f.orig/nss/digits_dots.c 2016-02-19 15:54:24.962743572 +0300
+++ glibc-2.15-a316c1f/nss/digits_dots.c 2016-02-19 15:54:25.084743580 +0300
@@ -47,7 +47,10 @@
{
if (h_errnop)
*h_errnop = NETDB_INTERNAL;
@ -34,7 +13,7 @@ index 2b86295..e007ef4 100644
return -1;
}
@@ -83,14 +86,16 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -84,14 +87,16 @@
}
size_needed = (sizeof (*host_addr)
@ -53,7 +32,7 @@ index 2b86295..e007ef4 100644
__set_errno (ERANGE);
goto done;
}
@@ -109,7 +114,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -110,7 +115,7 @@
*buffer_size = 0;
__set_errno (save);
if (h_errnop != NULL)
@ -62,7 +41,7 @@ index 2b86295..e007ef4 100644
*result = NULL;
goto done;
}
@@ -149,7 +154,9 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -150,7 +155,9 @@
if (! ok)
{
*h_errnop = HOST_NOT_FOUND;
@ -73,7 +52,7 @@ index 2b86295..e007ef4 100644
*result = NULL;
goto done;
}
@@ -190,7 +197,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -191,7 +198,7 @@
if (buffer_size == NULL)
*status = NSS_STATUS_SUCCESS;
else
@ -82,7 +61,7 @@ index 2b86295..e007ef4 100644
goto done;
}
@@ -201,15 +208,6 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -202,15 +209,6 @@
if ((isxdigit (name[0]) && strchr (name, ':') != NULL) || name[0] == ':')
{
@ -98,7 +77,7 @@ index 2b86295..e007ef4 100644
switch (af)
{
default:
@@ -225,7 +223,10 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -226,7 +224,10 @@
/* This is not possible. We cannot represent an IPv6 address
in an `struct in_addr' variable. */
*h_errnop = HOST_NOT_FOUND;
@ -110,7 +89,7 @@ index 2b86295..e007ef4 100644
goto done;
case AF_INET6:
@@ -233,42 +234,6 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -234,42 +235,6 @@
break;
}
@ -153,7 +132,7 @@ index 2b86295..e007ef4 100644
for (cp = name;; ++cp)
{
if (!*cp)
@@ -281,7 +246,9 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
@@ -282,7 +247,9 @@
if (inet_pton (AF_INET6, name, host_addr) <= 0)
{
*h_errnop = HOST_NOT_FOUND;
@ -164,11 +143,10 @@ index 2b86295..e007ef4 100644
*result = NULL;
goto done;
}
diff --git glibc-2.17-c758a686/nss/getXXbyYY_r.c glibc-2.17-c758a686/nss/getXXbyYY_r.c
index 1067744..44d00f4 100644
--- glibc-2.17-c758a686/nss/getXXbyYY_r.c
+++ glibc-2.17-c758a686/nss/getXXbyYY_r.c
@@ -179,6 +179,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
diff -Naur glibc-2.15-a316c1f.orig/nss/getXXbyYY_r.c glibc-2.15-a316c1f/nss/getXXbyYY_r.c
--- glibc-2.15-a316c1f.orig/nss/getXXbyYY_r.c 2016-02-19 15:54:24.961743572 +0300
+++ glibc-2.15-a316c1f/nss/getXXbyYY_r.c 2016-02-19 15:54:25.084743580 +0300
@@ -180,6 +180,9 @@
case -1:
return errno;
case 1:
@ -178,20 +156,21 @@ index 1067744..44d00f4 100644
goto done;
}
#endif
@@ -288,7 +291,7 @@ done:
/* This happens when we weren't able to use a service for reasons other
than the module not being found. In such a case, we'd want to tell the
caller that errno has the real reason for failure. */
- *h_errnop = NETDB_INTERNAL;
+ *h_errnop = NETDB_INTERNAL;
else if (status != NSS_STATUS_SUCCESS && !any_service)
/* We were not able to use any service. */
*h_errnop = NO_RECOVERY;
diff --git glibc-2.17-c758a686/nss/test-digits-dots.c glibc-2.17-c758a686/nss/test-digits-dots.c
new file mode 100644
index 0000000..1efa344
--- /dev/null
+++ glibc-2.17-c758a686/nss/test-digits-dots.c
diff -Naur glibc-2.15-a316c1f.orig/nss/Makefile glibc-2.15-a316c1f/nss/Makefile
--- glibc-2.15-a316c1f.orig/nss/Makefile 2016-02-19 15:54:24.962743572 +0300
+++ glibc-2.15-a316c1f/nss/Makefile 2016-02-19 15:54:45.764744976 +0300
@@ -42,7 +42,7 @@
makedb-modules = xmalloc hash-string
extra-objs += $(makedb-modules:=.o)
-tests = test-netdb tst-nss-test1
+tests = test-netdb tst-nss-test1 test-digits-dots
xtests = bug-erange
include ../Makeconfig
diff -Naur glibc-2.15-a316c1f.orig/nss/test-digits-dots.c glibc-2.15-a316c1f/nss/test-digits-dots.c
--- glibc-2.15-a316c1f.orig/nss/test-digits-dots.c 1970-01-01 03:00:00.000000000 +0300
+++ glibc-2.15-a316c1f/nss/test-digits-dots.c 2016-02-19 15:54:25.084743580 +0300
@@ -0,0 +1,38 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.