diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-12-09 23:43:33 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-12-09 23:43:33 +0000 |
commit | 50093870ac3521e97557dd1e8c3f0b247f86859c (patch) | |
tree | ae4907e9cd1cb429100db1d4330160056e86099e | |
parent | d0479b8e4106796c0c578b3a805ac66aa3ee69b6 (diff) |
If buffer is to small, set the file handle for /etc/group back in some
more cases.
-rw-r--r-- | nis/nss_compat/compat-grp.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c index 58a5a7f525..12988eb356 100644 --- a/nis/nss_compat/compat-grp.c +++ b/nis/nss_compat/compat-grp.c @@ -312,6 +312,7 @@ getgrent_next_file (struct group *result, ent_t *ent, return NSS_STATUS_NOTFOUND; else { + fsetpos (ent->stream, &pos); __set_errno (ERANGE); return NSS_STATUS_TRYAGAIN; } @@ -366,9 +367,14 @@ getgrent_next_file (struct group *result, ent_t *ent, if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */ continue; else - return status; + { + if (status == NSS_STATUS_TRYAGAIN) + /* The parser ran out of space. */ + fsetpos (ent->stream, &pos); + return status; + } } - + /* +:... */ if (result->gr_name[0] == '+' && result->gr_name[1] == '\0') { @@ -436,6 +442,7 @@ internal_getgrnam_r (const char *name, struct group *result, ent_t *ent, return NSS_STATUS_NOTFOUND; else { + fsetpos (ent->stream, &pos); __set_errno (ERANGE); return NSS_STATUS_TRYAGAIN; } @@ -471,8 +478,7 @@ internal_getgrnam_r (const char *name, struct group *result, ent_t *ent, } /* -group */ - if (result->gr_name[0] == '-' && result->gr_name[1] != '\0' - && result->gr_name[1] != '@') + if (result->gr_name[0] == '-' && result->gr_name[1] != '\0') { if (strcmp (&result->gr_name[1], name) == 0) return NSS_STATUS_NOTFOUND; @@ -481,8 +487,7 @@ internal_getgrnam_r (const char *name, struct group *result, ent_t *ent, } /* +group */ - if (result->gr_name[0] == '+' && result->gr_name[1] != '\0' - && result->gr_name[1] != '@') + if (result->gr_name[0] == '+' && result->gr_name[1] != '\0') { if (strcmp (name, &result->gr_name[1]) == 0) { @@ -598,6 +603,7 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent, return NSS_STATUS_NOTFOUND; else { + fsetpos (ent->stream, &pos); __set_errno (ERANGE); return NSS_STATUS_TRYAGAIN; } @@ -633,16 +639,14 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent, } /* -group */ - if (result->gr_name[0] == '-' && result->gr_name[1] != '\0' - && result->gr_name[1] != '@') + if (result->gr_name[0] == '-' && result->gr_name[1] != '\0') { blacklist_store_name (&result->gr_name[1], ent); continue; } /* +group */ - if (result->gr_name[0] == '+' && result->gr_name[1] != '\0' - && result->gr_name[1] != '@') + if (result->gr_name[0] == '+' && result->gr_name[1] != '\0') { enum nss_status status; |