diff options
author | drochner <drochner@pkgsrc.org> | 2005-09-19 15:54:42 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2005-09-19 15:54:42 +0000 |
commit | eb5f18808bc728508d0eb5a95bba3e8f37772ad9 (patch) | |
tree | 04d54a6daad27bd326ba981e0f80f4552e5944b6 /databases | |
parent | 68c7d427395e34839c61278165920bd0414fa033 (diff) | |
download | pkgsrc-eb5f18808bc728508d0eb5a95bba3e8f37772ad9.tar.gz |
on LDAP errors, restore the state of the group array
Diffstat (limited to 'databases')
-rw-r--r-- | databases/nss_ldap/files/netbsd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/databases/nss_ldap/files/netbsd.c b/databases/nss_ldap/files/netbsd.c index 06792f312e3..3568fb6e67c 100644 --- a/databases/nss_ldap/files/netbsd.c +++ b/databases/nss_ldap/files/netbsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd.c,v 1.3 2005/08/30 16:12:02 drochner Exp $ */ +/* $NetBSD: netbsd.c,v 1.4 2005/09/19 15:54:42 drochner Exp $ */ #include <sys/param.h> #include <pwd.h> @@ -453,6 +453,7 @@ netbsd_getgroupmembership(void *rv, void *cb_data, va_list ap) int *size = va_arg(ap, int*); gid_t *tmpgroups; long int lstart, lsize; + int origsize = *size; tmpgroups = malloc(limit * sizeof(gid_t)); if (!tmpgroups) @@ -476,7 +477,8 @@ netbsd_getgroupmembership(void *rv, void *cb_data, va_list ap) } *size = lstart; s = NSS_STATUS_NOTFOUND; - } + } else + *size = origsize; free(tmpgroups); return nss2netbsderr[s]; |