When I try to use portage it fails following: # emerge /usr/portage/sys-apps/portage/portage-2.0.49_pre17.ebuild Calculating dependencies ...done! >>> emerge (1 of 1) sys-apps/portage-2.0.49_pre17 to / >>> md5 src_uri ;-) portage-2.0.49_pre17.tar.bz2 >>> Unpacking source... >>> Unpacking portage-2.0.49_pre17.tar.bz2 to /var/tmp/portage/portage-2.0.49_pre17/work >>> Source unpacked. Traceback (most recent call last): File "/usr/bin/emerge", line 2051, in ? mydepgraph.merge(mydepgraph.altlist()) File "/usr/bin/emerge", line 1266, in merge retval=portage.doebuild(y,"package",myroot,edebug) File "/usr/lib/python2.2/site-packages/portage.py", line 1762, in doebuild return spawnebuild(mydo,actionmap,debug) File "/usr/lib/python2.2/site-packages/portage.py", line 1495, in spawnebuild retval=spawnebuild(actionmap[mydo]["dep"],actionmap,debug,alwaysdep) File "/usr/lib/python2.2/site-packages/portage.py", line 1495, in spawnebuild retval=spawnebuild(actionmap[mydo]["dep"],actionmap,debug,alwaysdep) File "/usr/lib/python2.2/site-packages/portage.py", line 1502, in spawnebuild actionmap[mydo]["args"][1]) File "/usr/lib/python2.2/site-packages/portage.py", line 1061, in spawn os.setgroups([portage_gid]) OSError: [Errno 1] Operation not permitted Removing the setgroups statement in line 1061 fixes it. I am running 2.6.0_test1 and python-2.2.3-r1. Also according to what I found on the web it appears that setgroups will be removed from python-2.3
Well removing setgroups just borks it later on. Sorry, now files don't get chowned well
Also breaks here (gentoo-sources-2.4.20-r5), works in 49_pre16.
I checked the code differences. The significant difference being that in -r16 the dropping of the mode is done in the child that is created as the result of the fork, while in the new code it is done before the fork. I didn't check it, but I believe that the dropping code is called multiple times (with each part of the stage). Calling setgroup is only allowed as root though, and it is (like its cousins) irrevocable. Causing things not to work. Moving the change of uid back into the fork code should probably fix things
Yeah, Paul nabbed it. Dropped all root rights instead of just the childs. Fixed for _pre18