Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26701 - Using emerge -f to d/l a package while using FEATURES="userpriv" causes permission problems during the latter attempt to emerge
Summary: Using emerge -f to d/l a package while using FEATURES="userpriv" causes permi...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 18260 (view as bug list)
Depends on:
Blocks: 16575
  Show dependency tree
 
Reported: 2003-08-16 00:34 UTC by qube99
Modified: 2011-10-30 22:17 UTC (History)
1 user (show)

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


Attachments
patch for portage.py (bugs.26701.patch,1.17 KB, patch)
2003-08-17 14:30 UTC, Masatomo Nakano (RETIRED)
Details | Diff
patch for portage.py (.49-r2) (bugs.26701.patch,1.74 KB, patch)
2003-08-31 12:31 UTC, Masatomo Nakano (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description qube99 2003-08-16 00:34:56 UTC
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.
Comment 1 David M. Andersen 2003-08-17 05:53:11 UTC
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
Comment 2 Masatomo Nakano (RETIRED) gentoo-dev 2003-08-17 14:30:13 UTC
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?
Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2003-08-31 11:16:40 UTC
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 ?
Comment 4 Masatomo Nakano (RETIRED) gentoo-dev 2003-08-31 12:31:05 UTC
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"
Comment 5 Masatomo Nakano (RETIRED) gentoo-dev 2003-08-31 12:31:59 UTC
Created attachment 16865 [details, diff]
patch for portage.py (.49-r2)
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2003-10-12 15:56:08 UTC
*** Bug 18260 has been marked as a duplicate of this bug. ***
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2004-02-04 23:18:53 UTC
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 ?
Comment 8 Brian Harring (RETIRED) gentoo-dev 2004-08-17 01:04:09 UTC
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.