diff options
Diffstat (limited to 'nis/nss_nisplus/nisplus-spwd.c')
-rw-r--r-- | nis/nss_nisplus/nisplus-spwd.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/nis/nss_nisplus/nisplus-spwd.c b/nis/nss_nisplus/nisplus-spwd.c index 54bbc32f3c..094f56d255 100644 --- a/nis/nss_nisplus/nisplus-spwd.c +++ b/nis/nss_nisplus/nisplus-spwd.c @@ -177,8 +177,11 @@ _nss_nisplus_getspnam_r (const char *name, struct spwd *sp, return status; } - if (name == NULL || strlen (name) > 8) - return NSS_STATUS_NOTFOUND; + if (name == NULL) + { + *errnop = EINVAL; + return NSS_STATUS_NOTFOUND; + } else { nis_result *result; @@ -200,15 +203,16 @@ _nss_nisplus_getspnam_r (const char *name, struct spwd *sp, errnop); nis_freeresult (result); - if (parse_res == -1) + if (parse_res < 1) { - *errnop = ERANGE; - return NSS_STATUS_TRYAGAIN; + if (parse_res == -1) + { + *errnop = ERANGE; + return NSS_STATUS_TRYAGAIN; + } + else + return NSS_STATUS_NOTFOUND; } - - if (parse_res) - return NSS_STATUS_SUCCESS; - - return NSS_STATUS_NOTFOUND; + return NSS_STATUS_SUCCESS; } } |