summaryrefslogtreecommitdiff
path: root/nis/nss_compat/compat-spwd.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-12-12 02:30:31 +0000
committerUlrich Drepper <drepper@redhat.com>1997-12-12 02:30:31 +0000
commit3d86ce7fef87bdc030e2d77677b6a919ada72e17 (patch)
tree723c8fd3533981959167b1f72663408b542807c2 /nis/nss_compat/compat-spwd.c
parent3af3bc37bfda39adcab8d814827f321daef91b13 (diff)
Reset the blacklist correct, fix return code for non existent +name
entries.
Diffstat (limited to 'nis/nss_compat/compat-spwd.c')
-rw-r--r--nis/nss_compat/compat-spwd.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/nis/nss_compat/compat-spwd.c b/nis/nss_compat/compat-spwd.c
index 1560a72bf6..76ce8831e7 100644
--- a/nis/nss_compat/compat-spwd.c
+++ b/nis/nss_compat/compat-spwd.c
@@ -146,9 +146,14 @@ internal_setspent (ent_t *ent)
ent->oldkeylen = 0;
}
- ent->blacklist.current = 0;
if (ent->blacklist.data != NULL)
- ent->blacklist.data[0] = '\0';
+ {
+ ent->blacklist.current = 1;
+ ent->blacklist.data[0] = '|';
+ ent->blacklist.data[1] = '\0';
+ }
+ else
+ ent->blacklist.current = 0;
if (ent->stream == NULL)
{
@@ -222,9 +227,14 @@ internal_endspent (ent_t *ent)
ent->oldkeylen = 0;
}
- ent->blacklist.current = 0;
if (ent->blacklist.data != NULL)
- ent->blacklist.data[0] = '\0';
+ {
+ ent->blacklist.current = 1;
+ ent->blacklist.data[0] = '|';
+ ent->blacklist.data[1] = '\0';
+ }
+ else
+ ent->blacklist.current = 0;
give_spwd_free (&ent->pwd);
@@ -458,12 +468,11 @@ getspnam_plususer (const char *name, struct spwd *result, char *buffer,
buflen -= plen;
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
- return NSS_STATUS_TRYAGAIN;
+ return NSS_STATUS_NOTFOUND;
if (yp_match (domain, "shadow.byname", name, strlen (name),
- &outval, &outvallen)
- != YPERR_SUCCESS)
- return NSS_STATUS_TRYAGAIN;
+ &outval, &outvallen) != YPERR_SUCCESS)
+ return NSS_STATUS_NOTFOUND;
ptr = strncpy (buffer, outval, buflen < (size_t) outvallen ?
buflen : (size_t) outvallen);
buffer[buflen < (size_t) outvallen ? buflen : (size_t) outvallen] = '\0';
@@ -596,7 +605,8 @@ getspent_next_file (struct spwd *result, ent_t *ent,
if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
break;
else
- if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */
+ if (status == NSS_STATUS_RETURN /* We couldn't parse the entry */
+ || status == NSS_STATUS_NOTFOUND) /* entry doesn't exist */
continue;
else
{
@@ -605,7 +615,7 @@ getspent_next_file (struct spwd *result, ent_t *ent,
return status;
}
}
-
+
/* +:... */
if (result->sp_namp[0] == '+' && result->sp_namp[1] == '\0')
{