Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25569 - Portage 2.0.49_pre17 fails because of os.setgroups failing
Summary: Portage 2.0.49_pre17 fails because of os.setgroups failing
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 19888
  Show dependency tree
 
Reported: 2003-07-30 05:20 UTC by Paul de Vrieze (RETIRED)
Modified: 2011-10-30 22:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul de Vrieze (RETIRED) gentoo-dev 2003-07-30 05:20:11 UTC
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
Comment 1 Paul de Vrieze (RETIRED) gentoo-dev 2003-07-30 10:52:25 UTC
Well removing setgroups just borks it later on. Sorry, now files don't get chowned well
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2003-07-31 13:34:26 UTC
Also breaks here (gentoo-sources-2.4.20-r5), works in 49_pre16.
Comment 3 Paul de Vrieze (RETIRED) gentoo-dev 2003-08-05 07:00:00 UTC
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
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2003-08-06 02:14:13 UTC
Yeah, Paul nabbed it. Dropped all root rights instead of just the
childs. Fixed for _pre18