Author Alexander.Belopolsky
Recipients Alexander.Belopolsky, l0nwlf, loewis, michael.foord, orsenthil, ronaldoussoren
Date 2010-02-22.15:57:39
SpamBayes Score 9.06353e-09
Marked as misclassified No
Message-id <1266854261.19.0.272852387087.issue7900@psf.upfronthosting.co.za>
In-reply-to
Content
Here is another interesting fact: Mac OS 10.6 comes with python 2.5 and 2.6 preinstalled:

$ python2.5 -V
Python 2.5.3c1
$ python2.6 -V
Python 2.6.1

Neither of these exhibit the same bug, but both are broken in some way.  Given

$ cat tg.py
import os
g = os.getgroups()
print g
os.setgroups(g[:5])
print os.getgroups()

$ sudo python2.5 tg.py
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2]
[0, 101, 204, 100, 98]
$ sudo python2.6 tg.py
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2, 1, 401]
[0, 101, 204, 100, 98, 80, 61, 29, 20, 12, 9, 8, 5, 4, 3, 2, 1, 401]

Note that python2.5 truncates the group list which is 
$ sudo id -G
0 101 204 100 98 80 61 29 20 12 9 8 5 4 3 2 1 401

but setgroups works as expected.  In contrast, python2.6 reports all groups correctly, but setgroups has no effect.
History
Date User Action Args
2010-02-22 15:57:41Alexander.Belopolskysetrecipients: + Alexander.Belopolsky, loewis, ronaldoussoren, orsenthil, michael.foord, l0nwlf
2010-02-22 15:57:41Alexander.Belopolskysetmessageid: <1266854261.19.0.272852387087.issue7900@psf.upfronthosting.co.za>
2010-02-22 15:57:40Alexander.Belopolskylinkissue7900 messages
2010-02-22 15:57:39Alexander.Belopolskycreate