Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67791 - No Warnings if User in too many Groups.
Summary: No Warnings if User in too many Groups.
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
: 297950 (view as bug list)
Depends on:
Reported: 2004-10-16 09:31 UTC by Decibels
Modified: 2009-12-24 13:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Decibels 2004-10-16 09:31:40 UTC
Noticed this problem when trying to start frozen-bubble as user. Worked for
root, but didn't for user, even though User in GAMES Group. After extensive
testing, found it was because max groups of 32 was violated. This is a cause
of confusion because the system will report all the groups user in, even if over 32
groups. So, user can check if in Games Group and if is, still can't start game.
Why, because frozen-bubble checks to see if the three folders are readable to user and if 
they aren't, perl thinks they are only in 'users' group. If the code is changed to just
see if folder 'exists' instead of 'readable' then game works for user.

Besides Perl, I have found this problem with Python also. Only one I have noticed
so far is the 'portage' group. If past limit of groups, it just doesn't work for
user (search & pretend).

Know that going over 32 groups is a concern to some, but have found enough on
the net, of admins,... wanting more than 32. I have even dropped the number of
groups I am in, but the lack of proper error messages is what concerns me. There
is no type of warning that anything over 32 groups is the problem. Maybe even just
a Gentoo Doc on the use/overuse of groups would do.

Have also found info that as of kernel 2.6.4 it has been changed to 64k for groups. Think
there is an overuse of ngroups_max that mean different things, so maybe the kernel
is still at 32? Got confused over that issue and lack of information. Still, not
having a warning of some kind can cause problems.


[PATCH] NGROUPS 2.6.2rc2 + fixups

From: Tim Hockin <>,
Neil Brown <>,

New groups infrastructure. task->groups and task->ngroups are replaced by
task->group_info. Group)info is a refcounted, dynamic struct with an array
of pages. This allows for large numbers of groups. The current limit of
32 groups has been raised to 64k groups. It can be raised more by changing
the NGROUPS_MAX constant in limits.h
Is above talking about number of groups available or max groups a user can be in?

POSIX Information:
bash-2.05b$ getconf _POSIX_NGROUPS_MAX
bash-2.05b$ getconf NGROUPS_MAX

This might be a warning, but very unclear.
Python: (if user in more than 32):
>>> import os,sys
>>> os.getgroups()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
OSError: [Errno 22] Invalid argument

Python: (if user in 32 or less):
>>> import os,sys
>>> os.getgroups()
[5, 7, 10, 11, 12, 15, 16, 17, 18, 19, 21, 22, 27, 35, 60, 70, 80, 85, 100, 101, 102, 
  250, 407, 409, 411, 412]

Perl: (if user in more than 32)
bash-2.05b$ perl
This script is running as david who belongs to the following groups: users

Perl: (if user in 32 or less):
This script is running as david who belongs to the following groups: users 
scanner clamav speech slocate portage foldingathome cdrecording users usb cdrw 
postgres mysql games video ftp cdrom audio console cron man mail floppy 
wheel lp tty

Not sure what can be done as far as a warnings. There should be at least more detailed
Gentoo Docs describing groups usage, some problems that can occur if violate this.

Reproducible: Always
Steps to Reproduce:
1. Put user in more than 32 groups and try to run frozen-bubble.
2. It has to be a a script that checks if user in group or getsgroups.
3. Failure. But Error messages are invalid. No clear way to troubleshoot.
4. Clearing this up might clarify a lot of bugs.

Expected Results:  
Some type of warning that user is in too many groups. Or Docs explaining usage
of groups better to clarify problems that can occur.
Comment 1 SpanKY gentoo-dev 2005-01-09 21:55:16 UTC
the only place we could really add such a warning is to the group* functions that are part of shadow ... and even that wouldnt really work if someone edits /etc/group by hand ...
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-06-04 09:21:22 UTC
Eh? NOTABUG? Perhaps a time to close this.
Comment 3 SpanKY gentoo-dev 2006-11-10 23:40:50 UTC
doesnt really seem to be a way to "solve" this
Comment 4 SpanKY gentoo-dev 2009-12-24 13:32:46 UTC
*** Bug 297950 has been marked as a duplicate of this bug. ***