all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob e79333d5e10f9f6b90e71c36f120ccc63c861072 1829 bytes (raw)
name: gnu/packages/patches/glibc-2-26-0024.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
From 8f46c6052408a23a77ecf46aa378120c1a4afe37 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 1 Sep 2017 08:57:28 +0200
Subject: [PATCH 24/90] getaddrinfo: Properly set errno for NSS function lookup
 failure

(cherry picked from commit ad816a5e00ce891a2cea8187638fa0e00f83aaf6)

diff --git a/ChangeLog b/ChangeLog
index d53c8fe083..2f959d4c36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Make reporting of NSS
+	function lookup failures more reliable.
+
 2017-09-01  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gethosts): Use h_errno directly.
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 076e1fa62b..eaf8bafcf4 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -923,13 +923,17 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    }
 		  else
 		    {
+		      /* Could not locate any of the lookup functions.
+			 The NSS lookup code does not consistently set
+			 errno, so we need to supply our own error
+			 code here.  The root cause could either be a
+			 resource allocation failure, or a missing
+			 service function in the DSO (so it should not
+			 be listed in /etc/nsswitch.conf).  Assume the
+			 former, and return EBUSY.  */
 		      status = NSS_STATUS_UNAVAIL;
-		      /* Could not load any of the lookup functions.  Indicate
-		         an internal error if the failure was due to a system
-			 error other than the file not being found.  We use the
-			 errno from the last failed callback.  */
-		      if (errno != 0 && errno != ENOENT)
-			__set_h_errno (NETDB_INTERNAL);
+		     __set_h_errno (NETDB_INTERNAL);
+		     __set_errno (EBUSY);
 		    }
 		}
 

debug log:

solving e79333d5e ...
found e79333d5e in https://yhetil.org/guix/87ine0pjiu.fsf@fastmail.com/ ||
	https://yhetil.org/guix/87d148pe57.fsf@fastmail.com/

applying [1/1] https://yhetil.org/guix/87ine0pjiu.fsf@fastmail.com/
diff --git a/gnu/packages/patches/glibc-2-26-0024.patch b/gnu/packages/patches/glibc-2-26-0024.patch
new file mode 100644
index 000000000..e79333d5e

1:26: trailing whitespace.
 
1:27: space before tab in indent.
 	* sysdeps/posix/getaddrinfo.c (gethosts): Use h_errno directly.
1:33: space before tab in indent.
 		    }
1:34: space before tab in indent.
 		  else
1:35: space before tab in indent.
 		    {
Checking patch gnu/packages/patches/glibc-2-26-0024.patch...
Applied patch gnu/packages/patches/glibc-2-26-0024.patch cleanly.
warning: squelched 5 whitespace errors
warning: 10 lines add whitespace errors.

skipping https://yhetil.org/guix/87d148pe57.fsf@fastmail.com/ for e79333d5e
index at:
100644 e79333d5e10f9f6b90e71c36f120ccc63c861072	gnu/packages/patches/glibc-2-26-0024.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.