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-mymachines | |
parent | docs: note that udev doesn't deal with binary attribute values (#11383) (diff) | |
download | systemd-0192cbdb2c19ed2abbf6662090f45ab3bf4caf56.tar.xz systemd-0192cbdb2c19ed2abbf6662090f45ab3bf4caf56.zip |
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-mymachines')
-rw-r--r-- | src/nss-mymachines/nss-mymachines.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index 332d440a51..3d1fc28353 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -153,7 +153,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r( l = strlen(name); 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; } @@ -227,7 +227,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; *h_errnop = NO_DATA; return NSS_STATUS_UNAVAIL; } @@ -313,7 +313,7 @@ enum nss_status _nss_mymachines_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; } @@ -396,7 +396,7 @@ enum nss_status _nss_mymachines_gethostbyname3_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; *h_errnop = NO_DATA; return NSS_STATUS_UNAVAIL; } @@ -484,7 +484,7 @@ enum nss_status _nss_mymachines_getpwnam_r( l = strlen(name); if (buflen < l+1) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -501,7 +501,7 @@ enum nss_status _nss_mymachines_getpwnam_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; return NSS_STATUS_UNAVAIL; } @@ -564,7 +564,7 @@ enum nss_status _nss_mymachines_getpwuid_r( return NSS_STATUS_NOTFOUND; if (snprintf(buffer, buflen, "vu-%s-" UID_FMT, machine, (uid_t) mapped) >= (int) buflen) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -579,7 +579,7 @@ enum nss_status _nss_mymachines_getpwuid_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; return NSS_STATUS_UNAVAIL; } @@ -662,7 +662,7 @@ enum nss_status _nss_mymachines_getgrnam_r( l = sizeof(char*) + strlen(name) + 1; if (buflen < l) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -677,7 +677,7 @@ enum nss_status _nss_mymachines_getgrnam_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; return NSS_STATUS_UNAVAIL; } @@ -740,13 +740,13 @@ enum nss_status _nss_mymachines_getgrgid_r( return NSS_STATUS_NOTFOUND; if (buflen < sizeof(char*) + 1) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } memzero(buffer, sizeof(char*)); if (snprintf(buffer + sizeof(char*), buflen - sizeof(char*), "vg-%s-" GID_FMT, machine, (gid_t) mapped) >= (int) buflen) { - *errnop = DISARM_PROTECT_ERRNO(ERANGE); + *errnop = ERANGE; return NSS_STATUS_TRYAGAIN; } @@ -758,6 +758,6 @@ enum nss_status _nss_mymachines_getgrgid_r( return NSS_STATUS_SUCCESS; fail: - *errnop = DISARM_PROTECT_ERRNO(r); + *errnop = -r; return NSS_STATUS_UNAVAIL; } |