From e70df46b9721a3d025e7a0b4ffb5893cbde5e55d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 1 Aug 2014 16:01:12 +0200 Subject: nss: always explicitly reset all error variables glibc appears to be broken if we don't explicitly reset all error variables, let's work around that. https://bugzilla.redhat.com/show_bug.cgi?id=1125975 --- src/nss-mymachines/nss-mymachines.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nss-mymachines/nss-mymachines.c') diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index 985ebb7134..cc185b0c3d 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -205,6 +205,11 @@ enum nss_status _nss_mymachines_gethostbyname4_r( if (ttlp) *ttlp = 0; + /* Explicitly reset all error variables */ + *errnop = 0; + *h_errnop = NETDB_SUCCESS; + h_errno = 0; + return NSS_STATUS_SUCCESS; fail: @@ -365,6 +370,11 @@ enum nss_status _nss_mymachines_gethostbyname3_r( if (canonp) *canonp = r_name; + /* Explicitly reset all error variables */ + *errnop = 0; + *h_errnop = NETDB_SUCCESS; + h_errno = 0; + return NSS_STATUS_SUCCESS; fail: -- cgit v1.2.3-54-g00ecf