Displaying 4 results from an estimated 4 matches for "groups_bygid".
2004 Feb 20
1
NGROUPS_MAX on Linux
...ude "log.h"
static int ngroups;
-static char *groups_byname[NGROUPS_MAX + 1]; /* +1 for base/primary group */
+static char **groups_byname;
/*
* Initialize group access list for user with primary (base) and
@@ -40,20 +40,33 @@
int
ga_init(const char *user, gid_t base)
{
- gid_t groups_bygid[NGROUPS_MAX + 1];
- int i, j;
+ gid_t *groups_bygid;
+ int i;
struct group *gr;
if (ngroups > 0)
ga_free();
- ngroups = sizeof(groups_bygid) / sizeof(gid_t);
+ getgrouplist(user, base, NULL, &ngroups);
+ groups_bygid = xmalloc(ngroups * sizeof(*groups_bygid));
+ groups_byname = xm...
2006 May 04
2
xmalloc(foo*bar) -> xcalloc(foo, bar) for Portable
...nssh_cvs/groupaccess.c,v
retrieving revision 1.10
diff -u -p -r1.10 groupaccess.c
--- groupaccess.c 26 Mar 2006 03:24:49 -0000 1.10
+++ groupaccess.c 4 May 2006 01:56:11 -0000
@@ -52,8 +52,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...
2002 Sep 25
1
NGROUPS_MAX
...s on the NGROUPS_MAX define. This makes
the number of allowed simultaneous (per-user) secondary groups a
compile-time decision.
$ find . -name \*.c | xargs grep NGROUPS_MAX
./groupaccess.c:static char *groups_byname[NGROUPS_MAX + 1]; /* +1 for base/primary group */
./groupaccess.c: gid_t groups_bygid[NGROUPS_MAX + 1];
./uidswap.c:static gid_t saved_egroups[NGROUPS_MAX], user_groups[NGROUPS_MAX];
./uidswap.c: saved_egroupslen = getgroups(NGROUPS_MAX, saved_egroups);
./uidswap.c: user_groupslen = getgroups(NGROUPS_MAX, user_groups);
POSIX defined sysconf in order to avoid th...
2004 Feb 20
24
[Bug 787] Minor security problem due to use of deprecated NGROUPS_MAX in uidswap.c (sshd)
http://bugzilla.mindrot.org/show_bug.cgi?id=787
------- Additional Comments From openssh_bugzilla at hockin.org 2004-02-20 13:01 -------
Created an attachment (id=548)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=548&action=view)
NGROUPS patch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.