Commit f671d6aa authored by Leigh B. Stoller's avatar Leigh B. Stoller

Nasty kludge to deal with users in NGROUPS groups.

parent 9c2bbad8
......@@ -442,15 +442,18 @@ int main(int argc, char *argv[])
ngroups = NGROUPS;
getgrouplist(actual_uname, primary_gid, groups, &ngroups);
if (ngroups == NGROUPS) {
log_err("emerg: failed to getgroups (%ld: %s)\n", gid, cmd);
exit(109);
log_err("crit: Too many groups (%ld: %s)\n", gid, cmd);
}
for (i = 0; i < ngroups; i++) {
if (groups[i] == gid)
break;
}
if (i == ngroups)
if (i == ngroups) {
/* Nasty! */
if (i == NGROUPS)
ngroups--;
groups[ngroups++] = gid;
}
if (((setgid(primary_gid)) != 0) ||
(setgroups(ngroups, groups) != 0)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment