[Python-Dev] os.getgroups() on MacOS X Was: red buildbots on 2.7
"Martin v. Löwis"
martin at v.loewis.de
Wed Jun 23 20:29:44 CEST 2010
> The problem that _DARWIN_C_SOURCE introduces is that it replaces
> system getgroups with a database query effectively making the true
> process' list of supplementary group IDs inaccessible to programs.
> See source code at
> <http://www.opensource.apple.com/source/Libc/Libc-594.1.4/sys/getgroups.c>.
If that is true (i.e. the file is really the one that is being used),
I think this is a severe flaw in OSX's implementation of the POSIX
specification.
Then, I agree that Python, in turn, should make sure that
posix.getgroups is really the POSIX version of getgroups, not the Apple
version. This is a general principle: if the system has two competing
implementations of some API, the Python posix module should strive to
call the POSIX version of the API. If the vendor's version of the API is
also useful, it can be exposed under a different name (if, in turn, this
is technically possible).
Just my 0.02€.
Regards,
Martin
More information about the Python-Dev
mailing list