diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-10 16:09:52 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-10 21:23:14 +0100 |
commit | 0192cbdb2c19ed2abbf6662090f45ab3bf4caf56 (patch) | |
tree | 97abcf845575b1b5a0b47a8935bb8b713ffab6f0 /src/nss-resolve | |
parent | 8e44f5710b1e7d843d224f5344e31383b685dbbf (diff) | |
download | systemd-0192cbdb2c19ed2abbf6662090f45ab3bf4caf56.tar.gz |
Revert "nss: prevent PROTECT_ERRNO from squashing changes to *errnop"
This reverts commit b26c90411343d74b15deb24bd87077848e316dab.
I don't see anythign wrong, but Ubuntu autopkgtest CI started failing fairly
consistently since this was merged. Let's see if reverting fixes things.
Diffstat (limited to 'src/nss-resolve')
-rw-r--r-- | src/nss-resolve/nss-resolve.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c index a283384f90..a28b5d8ba8 100644 --- a/src/nss-resolve/nss-resolve.c +++ b/src/nss-resolve/nss-resolve.c @@ -186,7 +186,7 @@ enum nss_status _nss_resolve_gethostbyname4_r( l = strlen(canonical); ms = ALIGN(l+1) + ALIGN(sizeof(struct gaih_addrtuple)) * c; if (buflen < ms) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -267,7 +267,7 @@ enum nss_status _nss_resolve_gethostbyname4_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; *h_errnop = NO_RECOVERY; return ret; @@ -364,7 +364,7 @@ enum nss_status _nss_resolve_gethostbyname3_r( ms = ALIGN(l+1) + c * ALIGN(alen) + (c+2) * sizeof(char*); if (buflen < ms) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -455,7 +455,7 @@ enum nss_status _nss_resolve_gethostbyname3_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; *h_errnop = NO_RECOVERY; return ret; @@ -492,13 +492,13 @@ enum nss_status _nss_resolve_gethostbyaddr2_r( assert(h_errnop); if (!IN_SET(af, AF_INET, AF_INET6)) { - *errnop = DISARM_PROTECT_ERRNO(EAFNOSUPPORT); + *errnop = EAFNOSUPPORT; *h_errnop = NO_DATA; return NSS_STATUS_UNAVAIL; } if (len != FAMILY_ADDRESS_SIZE(af)) { - *errnop = DISARM_PROTECT_ERRNO(EINVAL); + *errnop = EINVAL; *h_errnop = NO_RECOVERY; return NSS_STATUS_UNAVAIL; } @@ -576,7 +576,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r( c * sizeof(char*); /* pointers to aliases, plus trailing NULL */ if (buflen < ms) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; *h_errnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -636,7 +636,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; *h_errnop = NO_RECOVERY; return ret; |