
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2010-07-23 13:10 byronaldoussoren, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 9344.patch | rosslagerwall,2010-12-12 10:41 | patch to implement getgrouplist for py3k against r87178 | review | |
| 9344_v2.patch | rosslagerwall,2011-01-04 05:19 | Updated patch | review | |
| Messages (16) | |||
|---|---|---|---|
| msg111309 -(view) | Author: Ronald Oussoren (ronaldoussoren)*![]() | Date: 2010-07-23 13:10 | |
A number of unix systems expose a getgroupslist function to fetch the groups that a user is a member of. It would be nice if that function were exposed to python.Seeissue7900 for more information on why that would be useful. | |||
| msg118791 -(view) | Author: Vetoshkin Nikita (nvetoshkin) | Date: 2010-10-15 16:08 | |
Did a bit of digging and found that getgrouplist signature differs on (at least) Linux and Mac OS: -http://www.kernel.org/doc/man-pages/online/pages/man3/getgrouplist.3.html -http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/getgrouplist.3.html | |||
| msg119062 -(view) | Author: Alexander Belopolsky (belopolsky)*![]() | Date: 2010-10-18 18:50 | |
I don't see how this difference is relevant for exposing the functionality in python:Linux:int getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups);MacOS:int getgrouplist(const char *name, int basegid, int *groups, int *ngroups);The only difference is that Linux uses gid_t and MacOS uses int. The requested posix.getgrouplist() will take a python string and a python integer and return a list of integers. | |||
| msg119065 -(view) | Author: Vetoshkin Nikita (nvetoshkin) | Date: 2010-10-18 18:57 | |
@Alexander, it was just a note, that implementation in posixmodule.c won't be the same across all flavours of Unix :) | |||
| msg123834 -(view) | Author: Ross Lagerwall (rosslagerwall)![]() | Date: 2010-12-12 10:41 | |
Attached is a patch (against the latest revision, 87178) which adds the functionality to the posix module as well as adds a testcase for it.I haven't added it to the os module, I'm not sure if that should be done.I tested it on Linux & FreeBSD and it works as expected. Since I don't have an OS X system, I could not test it on there. | |||
| msg125293 -(view) | Author: Ross Lagerwall (rosslagerwall)![]() | Date: 2011-01-04 05:19 | |
A slightly updated patch. Targeting for 3.3. | |||
| msg125304 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2011-01-04 11:09 | |
I can't say anything about the functionality, but the patch looks good to me (works under Linux and Solaris - the latter missing getgrouplist()). | |||
| msg130927 -(view) | Author: Ronald Oussoren (ronaldoussoren)*![]() | Date: 2011-03-14 23:11 | |
Patch looks good, but this likely runs into the same problem as#7900: the user can be a member of more than NGROUPS_MAX on OSX.I'll test this tomorrow (by creating a temporary user that is a member of more than 16 groups). | |||
| msg132021 -(view) | Author: Alexander Belopolsky (belopolsky)*![]() | Date: 2011-03-24 19:20 | |
Looks good to me as well. Just a nit-pick: in python code base "sizeof" is not separated from the opening parenthesis. I understand the desire to distinguish "sizeof" from a function, but it is probably better to be consistent. | |||
| msg132022 -(view) | Author: Ross Lagerwall (rosslagerwall)![]() | Date: 2011-03-24 19:23 | |
Ronald, does it have the same problem as#7900 on OS X or can I commit? | |||
| msg138028 -(view) | Author: Ronald Oussoren (ronaldoussoren)*![]() | Date: 2011-06-09 20:55 | |
I haven't tested yet, but feel free to commit and I'll fix any OSX issues later. | |||
| msg138049 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2011-06-10 05:33 | |
New changeset9ebee3211be9 by Ross Lagerwall in branch 'default':Issue#9344: Add os.getgrouplist().http://hg.python.org/cpython/rev/9ebee3211be9 | |||
| msg138051 -(view) | Author: Ross Lagerwall (rosslagerwall)![]() | Date: 2011-06-10 05:59 | |
Thanks! | |||
| msg138103 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2011-06-10 16:21 | |
Nit: when a patch gets committed and the issue closed, the preferred resolution is "fixed" ;)(seehttp://docs.python.org/devguide/triaging.html#resolution) | |||
| msg138105 -(view) | Author: Ross Lagerwall (rosslagerwall)![]() | Date: 2011-06-10 16:24 | |
> Nit: when a patch gets committed and the issue closed, the preferred> resolution is "fixed" ;)> (seehttp://docs.python.org/devguide/triaging.html#resolution)Sure, I will try remember that. | |||
| msg138476 -(view) | Author: R. David Murray (r.david.murray)*![]() | Date: 2011-06-16 22:59 | |
Actually, when it is a feature request rather than a bug fix we usually use 'accepted'. It doesn't matter a whole lot, though. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:04 | admin | set | github: 53590 |
| 2011-06-16 22:59:08 | r.david.murray | set | nosy: +r.david.murray messages: +msg138476 |
| 2011-06-10 16:24:12 | rosslagerwall | set | messages: +msg138105 |
| 2011-06-10 16:21:32 | pitrou | set | resolution: accepted -> fixed messages: +msg138103 |
| 2011-06-10 05:59:50 | rosslagerwall | set | status: open -> closed resolution: accepted messages: +msg138051 stage: commit review -> resolved |
| 2011-06-10 05:33:18 | python-dev | set | nosy: +python-dev messages: +msg138049 |
| 2011-06-09 20:55:34 | ronaldoussoren | set | messages: +msg138028 |
| 2011-03-24 19:23:23 | rosslagerwall | set | messages: +msg132022 |
| 2011-03-24 19:20:35 | belopolsky | set | assignee:belopolsky ->rosslagerwall messages: +msg132021 |
| 2011-03-14 23:11:13 | ronaldoussoren | set | nosy:ronaldoussoren,belopolsky,pitrou,giampaolo.rodola,nvetoshkin,rosslagerwall messages: +msg130927 |
| 2011-01-17 13:36:32 | giampaolo.rodola | set | nosy: +giampaolo.rodola |
| 2011-01-04 11:09:19 | pitrou | set | nosy: +pitrou messages: +msg125304 stage: needs patch -> commit review |
| 2011-01-04 05:19:35 | rosslagerwall | set | files: +9344_v2.patch versions: + Python 3.3, - Python 3.2 messages: +msg125293 nosy:ronaldoussoren,belopolsky,nvetoshkin,rosslagerwall |
| 2010-12-12 10:41:02 | rosslagerwall | set | files: +9344.patch nosy: +rosslagerwall messages: +msg123834 keywords: +patch |
| 2010-10-18 18:57:41 | nvetoshkin | set | messages: +msg119065 |
| 2010-10-18 18:50:44 | belopolsky | set | messages: +msg119062 |
| 2010-10-15 16:08:38 | nvetoshkin | set | nosy: +nvetoshkin messages: +msg118791 |
| 2010-07-23 15:45:08 | belopolsky | set | assignee:belopolsky type: enhancement components: + Extension Modules stage: needs patch |
| 2010-07-23 13:11:21 | ronaldoussoren | set | nosy: +belopolsky |
| 2010-07-23 13:10:56 | ronaldoussoren | create | |