From: Anders Kaseorg Date: Wed, 12 Jun 2013 23:24:06 +0000 (-0400) Subject: end{pw,gr}ent, initgroups_dyn: Call all functions from the nonlocal chain X-Git-Tag: 2.1~1 X-Git-Url: http://andersk.mit.edu/gitweb/nss_nonlocal.git/commitdiff_plain/23ca0ded6f524a412d868f5bdc5bd7c9b6b1cc4e end{pw,gr}ent, initgroups_dyn: Call all functions from the nonlocal chain Signed-off-by: Anders Kaseorg --- diff --git a/nonlocal-group.c b/nonlocal-group.c index 4c0a5b1..57f01e2 100644 --- a/nonlocal-group.c +++ b/nonlocal-group.c @@ -213,7 +213,7 @@ _nss_nonlocal_endgrent(void) enum nss_status status; const struct walk_nss w = { .lookup = &__nss_group_nonlocal_lookup, .fct_name = "endgrent", - .status = &status + .status = &status, .all_values = 1, }; const __typeof__(&_nss_nonlocal_endgrent) self = NULL; @@ -361,7 +361,7 @@ _nss_nonlocal_initgroups_dyn(const char *user, gid_t group, long int *start, enum nss_status status; const struct walk_nss w = { .lookup = &__nss_group_nonlocal_lookup, .fct_name = "initgroups_dyn", - .status = &status, .errnop = errnop + .status = &status, .all_values = 1, .errnop = errnop }; const __typeof__(&_nss_nonlocal_initgroups_dyn) self = NULL; diff --git a/nonlocal-passwd.c b/nonlocal-passwd.c index f8e7f96..41ea498 100644 --- a/nonlocal-passwd.c +++ b/nonlocal-passwd.c @@ -204,7 +204,7 @@ _nss_nonlocal_endpwent(void) enum nss_status status; const struct walk_nss w = { .lookup = &__nss_passwd_nonlocal_lookup, .fct_name = "endpwent", - .status = &status + .status = &status, .all_values = 1, }; const __typeof__(&_nss_nonlocal_endpwent) self = NULL; diff --git a/nonlocal.h b/nonlocal.h index 9574ff8..7b8ca2f 100644 --- a/nonlocal.h +++ b/nonlocal.h @@ -49,6 +49,7 @@ typedef bool _Bool; struct walk_nss { enum nss_status *status; + int all_values; int (*lookup)(service_user **ni, const char *fct_name, void **fctp) internal_function; const char *fct_name; diff --git a/walk_nss.h b/walk_nss.h index 78d3575..24cf4c5 100644 --- a/walk_nss.h +++ b/walk_nss.h @@ -79,7 +79,8 @@ } goto walk_nss_morebuf; } - } while (__nss_next(&nip, w.fct_name, &fct.ptr, *w.status, 0) == 0); + } while (__nss_next(&nip, w.fct_name, &fct.ptr, *w.status, w.all_values) == + 0); if (w.buf != NULL && *w.status != NSS_STATUS_SUCCESS) { free(*w.buf);