diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-09-30 13:29:51 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2006-09-30 13:29:51 +0000 |
commit | 761efaa70c2ed8d35722b7bc234a46bf2457f876 (patch) | |
tree | bba6f2fe7855d7b0095f9dc7720dc27bea4d1fdf /crypto/openssh/groupaccess.c | |
parent | 30c2033ae748d441213eed2e5c3fae760cc8ea61 (diff) | |
download | src-test2-761efaa70c2ed8d35722b7bc234a46bf2457f876.tar.gz src-test2-761efaa70c2ed8d35722b7bc234a46bf2457f876.zip |
Notes
Diffstat (limited to 'crypto/openssh/groupaccess.c')
-rw-r--r-- | crypto/openssh/groupaccess.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/crypto/openssh/groupaccess.c b/crypto/openssh/groupaccess.c index f50879f83a9f..e73f62b22fdf 100644 --- a/crypto/openssh/groupaccess.c +++ b/crypto/openssh/groupaccess.c @@ -1,3 +1,4 @@ +/* $OpenBSD: groupaccess.c,v 1.12 2006/08/03 03:34:42 deraadt Exp $ */ /* * Copyright (c) 2001 Kevin Steves. All rights reserved. * @@ -23,10 +24,16 @@ */ #include "includes.h" -RCSID("$OpenBSD: groupaccess.c,v 1.6 2003/04/08 20:21:28 itojun Exp $"); -#include "groupaccess.h" +#include <sys/types.h> +#include <sys/param.h> + +#include <grp.h> +#include <unistd.h> +#include <stdarg.h> + #include "xmalloc.h" +#include "groupaccess.h" #include "match.h" #include "log.h" @@ -52,8 +59,8 @@ ga_init(const char *user, gid_t base) ngroups = MAX(NGROUPS_MAX, sysconf(_SC_NGROUPS_MAX)); #endif - groups_bygid = xmalloc(ngroups * sizeof(*groups_bygid)); - groups_byname = xmalloc(ngroups * sizeof(*groups_byname)); + groups_bygid = xcalloc(ngroups, sizeof(*groups_bygid)); + groups_byname = xcalloc(ngroups, sizeof(*groups_byname)); if (getgrouplist(user, base, groups_bygid, &ngroups) == -1) logit("getgrouplist: groups list too small"); |