Opened 18 years ago
Last modified 6 years ago
#600 defect closed fixed (fixed)
setgroups() raises when given too many groups, and nothing handles the error
Reported by: | Jean-Paul Calderone | Owned by: | |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | Keywords: | ||
Cc: | Glyph, radix, Jean-Paul Calderone, itamarst, Tv, Moshe Zadka, jknight | Branch: | |
Author: |
Description
Attachments (1)
Change History (12)
comment:3 Changed 18 years ago by
Yes and no. As much as it ever was :) From the bug report: "/home/radix/Projects/Twisted/twisted/python/util.py", line 578, in initgroups 2004/04/17 14:11 MDT [-] setgroups(l) 2004/04/17 14:11 MDT [-] ValueError: too many groups There is no code in twisted.python.util that would protect that setgroups from raising ValueErrors to the caller. Then again, this is a case of running against an OS-imposed limit, and I think that code MUST fail. Whether it should catch ValueError and raise something like TooManyGroupsError is another issue.
Changed 18 years ago by
Attachment: | setgroups.patch added |
---|
comment:4 Changed 18 years ago by
Here's part of a "fix". I think the rest of the fix comes in two parts: Don't even try to setgroups() if uid != 0 If Application is passed None for uid and gid, don't even call initgroups().
comment:7 Changed 17 years ago by
How is this fixed by that r13136? I don't see it doing anything else except not calling switchUID by default, and thus, making the bug appear less often. If you use --uid or --gid, and the users belongs to too many groups, it'll still fail in exactly the same way.
comment:8 Changed 17 years ago by
OMG, this is the code from glibc in initgroups(): do result = setgroups (ngroups, groups); while (result == -1 && errno == EINVAL && --ngroups > 0); That is fucking evil. I'll commit a fix to twisted to do the same.
comment:9 Changed 17 years ago by
Recording this just for future reference: the commit that actually "fixed" (read: covered up) things was r13140. Sorry for the noise, but I want that here or I'll keep re-searching the right commit all the time.
comment:10 Changed 11 years ago by
Owner: | Jean-Paul Calderone deleted |
---|
Note: See
TracTickets for help on using
tickets.