aboutsummaryrefslogtreecommitdiff
path: root/nis/nss_compat/compat-initgroups.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_compat/compat-initgroups.c')
-rw-r--r--nis/nss_compat/compat-initgroups.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/nis/nss_compat/compat-initgroups.c b/nis/nss_compat/compat-initgroups.c
index 9def98b..97ddaee 100644
--- a/nis/nss_compat/compat-initgroups.c
+++ b/nis/nss_compat/compat-initgroups.c
@@ -228,6 +228,7 @@ getgrent_next_nis (struct group *result, ent_t *ent, char *buffer,
&outval, &outvallen) != YPERR_SUCCESS)
{
ent->nis = 0;
+ *errnop = ENOENT;
return NSS_STATUS_UNAVAIL;
}
@@ -252,6 +253,7 @@ getgrent_next_nis (struct group *result, ent_t *ent, char *buffer,
!= YPERR_SUCCESS)
{
ent->nis = 0;
+ *errnop = ENOENT;
return NSS_STATUS_NOTFOUND;
}
@@ -403,11 +405,17 @@ getgrnam_plusgroup (const char *name, struct group *result, char *buffer,
int outvallen;
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
- return NSS_STATUS_NOTFOUND;
+ {
+ *errnop = ENOENT;
+ return NSS_STATUS_NOTFOUND;
+ }
if (yp_match (domain, "group.byname", name, strlen (name),
&outval, &outvallen) != YPERR_SUCCESS)
- return NSS_STATUS_NOTFOUND;
+ {
+ *errnop = ENOENT;
+ return NSS_STATUS_NOTFOUND;
+ }
if (buflen < ((size_t) outvallen + 1))
{
@@ -452,7 +460,10 @@ getgrent_next_file (struct group *result, ent_t *ent,
buffer[buflen - 1] = '\xff';
p = fgets (buffer, buflen, ent->stream);
if (p == NULL && feof (ent->stream))
- return NSS_STATUS_NOTFOUND;
+ {
+ *errnop = ENOENT;
+ return NSS_STATUS_NOTFOUND;
+ }
if (p == NULL || buffer[buflen - 1] != '\xff')
{
fsetpos (ent->stream, &pos);