]> andersk Git - gssapi-openssh.git/blobdiff - openssh/groupaccess.c
Import of OpenSSH 4.4p1
[gssapi-openssh.git] / openssh / groupaccess.c
index f50879f83a9fae7b0a72514b5d2cb72024cd7119..e73f62b22fdf29bfa6ac29a54f7abc8aef5d87cf 100644 (file)
@@ -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.
  *
  */
 
 #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");
This page took 0.512905 seconds and 4 git commands to generate.