[issue7900] posix.getgroups() failure on Mac OS X

Alexander Belopolsky report at bugs.python.org
Tue Jun 22 17:16:38 CEST 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Ronald,

Please see my python-dev post in "red buildbots on 2.7" thread: 

http://mail.python.org/pipermail/python-dev/2010-June/100873.html

I argue that we should apply a fix along the lines of no-darwin-ext.diff while waiting for Apple to fix their bugs and support more than 16 groups in getgroups properly.

Your latest patch, while prevents getgroups from raising an exception, does not change the fact that getgroups return wrong values if group membership changes within the process.

Note that I propose to undefine _DARWIN_C_SOURCE for posixmodule.c only.  I think that is the right thing to do because defining _DARWIN_C_SOURCE is for invoking non-POSIX behavior.  If you still thing there may be other functions in posixmodule.c that require _DARWIN_C_SOURCE, we can probably find a way to change only getgroups, but I cannot figure out how to do it without adding extra source files.

For your reference, here is how getgroups is declared in unistd.h:


#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE)
int      getgroups(int, gid_t []) __DARWIN_EXTSN(getgroups);
#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */
int      getgroups(int, gid_t []);
#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7900>
_______________________________________


More information about the Python-bugs-list mailing list