Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 420189 - FEATURES='userpriv userfetch' still leaves local distdir/ owned by root:root
Summary: FEATURES='userpriv userfetch' still leaves local distdir/ owned by root:root
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-08 06:00 UTC by SpanKY
Modified: 2012-06-08 17:20 UTC (History)
0 users

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


Attachments
emerge --info (emerge-info.log,23.95 KB, text/plain)
2012-06-08 06:00 UTC, SpanKY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2012-06-08 06:00:20 UTC
Created attachment 314635 [details]
emerge --info

even though i have userpriv stuff turned on, the distdir/ in the package-specific build tree is owned by root

# emerge nano --nodeps
... wait until after src_unpack then CTRL+C ...

# ls -l app-editors/nano-2.3.1-r1/distdir/ -a
drwxr-xr-x 2 root   portage  60 Jun  8 01:58 .
drwxrwxr-x 6 vapier portage 220 Jun  8 01:58 ..
lrwxrwxrwx 1 root   root     40 Jun  8 01:58 nano-2.3.1.tar.gz -> /usr/portage/distfiles/nano-2.3.1.tar.gz

i would expect that symlink and the distdir itself to be owned by $PORTAGE_USERNAME:$PORTAGE_GRPNAME, not by root:root ...
Comment 1 Zac Medico gentoo-dev 2012-06-08 06:48:50 UTC
Ebuilds aren't supposed to write anything in that directory, so if we go by the principle of least privilege, then we should really be going the opposite direction and treat any writes in that directory as a sandbox violation.
Comment 2 SpanKY gentoo-dev 2012-06-08 17:20:31 UTC
the reason i noticed wasn't because my ebuild was trying to write in there, it's because i tried to `rm -rf` the build dir and found i still needed to sudo just for that.

having that path be readable-only makes sense to me.  writes should throw sandbox violations so we'd notice.