It seems the user isn't switched to portage when fetching alone which is causing the problem. I'm not sure how else the fetch could create a file owned by root:portage with permissions 600. Reproducible: Always Steps to Reproduce: 1. emerge -f <package> 2. emerge <package> 3. Error from permissions, in my case 600 root:portage, because portage can't access the d/led file.
It seems to work perfectly fine here (with userpriv): root@laureate:~# emerge -f bash ... root@laureate:~# ls -la /usr/portage/distfiles/bash* -rw-r--r-- 1 root root 2744 Mar 24 11:16 /usr/portage/distfiles/bash-2.05b-gentoo.diff.bz2 -rw-r--r-- 1 root root 1956216 Mar 24 11:21 /usr/portage/distfiles/bash-2.05b.tar.gz -rw-r--r-- 1 root root 755 Feb 22 23:20 /usr/portage/distfiles/bash205b-002 -rw-r--r-- 1 root root 2356 Feb 22 23:20 /usr/portage/distfiles/bash205b-003 -rw-r--r-- 1 root root 1110 Feb 22 23:20 /usr/portage/distfiles/bash205b-004
Created attachment 16228 [details, diff] patch for portage.py Fixed. But I guess there is some reason it's not implemented ... Carpaski, what do you think?
How did you download the package? As a user or root? Were you using sudo? su (and exact command)? Do you change umask? What command did you use? Have you changed permissions on anything? What version of portage? emerge info ?
I'm not orignal poster so i'm not sure what he did. I think the problem is that a user set userpriv but distfiles/* owner are root. And a owner of /usr/portage/distfiles/* should be 'portage' user like distfiles/cvs-src/* when you set FEATURES='userpriv' because some people(me too) don't like fetch as root privirage. My patch makes fetch as 'portage' user privirage when FEATURE='userpriv' > How did you download the package? As a user or root? root > Were you using sudo? su (and exact command)? su - > Do you change umask? no (but if a user changes umask, portage should work normally) > What command did you use? emerge -f package (or emerge package) > Have you changed permissions on anything? no > What version of portage? portage-2.0.49-r2 > emerge info ? # emerge info Portage 2.0.49 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.21) ================================================================= System uname: 2.4.21 i686 Intel(R) XEON(TM) CPU 2.20GHz distcc 2.9 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.2 [enabled] ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -mcpu=i686 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox ccache autoaddcvs buildpkg userpriv" GENTOO_MIRRORS="http://212.219.247.13/sites/www.ibiblio.org/gentoo/ http://212.219.247.15/sites/www.ibiblio.org/gentoo/ http://212.219.247.17/sites/www.ibiblio.org/gentoo/ ftp://ftp.easynet.nl/mirror/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/masatomo/gentoo-x86" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 oss apm arts avi crypt encode foomaticdb gif imlib jpeg libg++ mad mikmod mmx mpeg ncurses nls oggvorbis pdflib png quicktime sdl spell svga truetype xml2 xmms xv zlib alsa gdbm berkdb slang readline ruby postgres gpm tcpd pam libwww ssl perl python opengl -gtk -X cjk -cups -java -motif -gnome -gtk -qt -kde"
Created attachment 16865 [details, diff] patch for portage.py (.49-r2)
*** Bug 18260 has been marked as a duplicate of this bug. ***
Hmm, unless I misread the code distfiles are now chmod to 664 on fetch with root:portage ownership, so this bug would be fixed. Nakano, do you think we can close this ?
Closing this; regardless of FEATURES="userpriv", I slipped a try/finally into pre18's fetch that ensures perms/owners are sane. Only way that code doesn't run is if portage is flat out sigkill'd afaik.