summaryrefslogtreecommitdiff
path: root/src/nss-systemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-16 21:29:09 +0100
committerMartin Pitt <martinpitt@users.noreply.github.com>2017-02-16 21:29:09 +0100
commitcda458a54a8f5b18af16d4465509d17e4162d455 (patch)
tree9f8207fed604b2a3528666e950e498aaa70969a1 /src/nss-systemd
parent8acdd72120728cfc1742d7c37ceac8c0ade28ee3 (diff)
nss: fix error to ERANGE for nss calls with too little buffer space (#5365)
This is a follow-up for #5359, fixing the error codes in a similar way for the other NSS modules. (user/group lookup calls don't have h_errnop, hence we don't update that in those cases)
Diffstat (limited to 'src/nss-systemd')
-rw-r--r--src/nss-systemd/nss-systemd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c
index fd5064c937..f404755dac 100644
--- a/src/nss-systemd/nss-systemd.c
+++ b/src/nss-systemd/nss-systemd.c
@@ -185,7 +185,7 @@ enum nss_status _nss_systemd_getpwnam_r(
l = strlen(name);
if (buflen < l+1) {
- *errnop = ENOMEM;
+ *errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
@@ -286,7 +286,7 @@ enum nss_status _nss_systemd_getpwuid_r(
l = strlen(translated) + 1;
if (buflen < l) {
- *errnop = ENOMEM;
+ *errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
@@ -386,7 +386,7 @@ enum nss_status _nss_systemd_getgrnam_r(
l = sizeof(char*) + strlen(name) + 1;
if (buflen < l) {
- *errnop = ENOMEM;
+ *errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
@@ -484,7 +484,7 @@ enum nss_status _nss_systemd_getgrgid_r(
l = sizeof(char*) + strlen(translated) + 1;
if (buflen < l) {
- *errnop = ENOMEM;
+ *errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}