summaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authordrochner <drochner@pkgsrc.org>2005-09-19 15:54:42 +0000
committerdrochner <drochner@pkgsrc.org>2005-09-19 15:54:42 +0000
commiteb5f18808bc728508d0eb5a95bba3e8f37772ad9 (patch)
tree04d54a6daad27bd326ba981e0f80f4552e5944b6 /databases
parent68c7d427395e34839c61278165920bd0414fa033 (diff)
downloadpkgsrc-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.c6
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];