Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 114550 - emerge fails to check for root privileges on --resume
Summary: emerge fails to check for root privileges on --resume
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 115839
  Show dependency tree
 
Reported: 2005-12-05 10:26 UTC by John Myers
Modified: 2005-12-21 08:13 UTC (History)
0 users

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


Attachments
Trivial patch to catch --resume (emerge-resume-root.patch,491 bytes, patch)
2005-12-07 19:16 UTC, Alec Warner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Myers 2005-12-05 10:26:13 UTC
I use sudo to start emerge. Most of the time I forget to prepend sudo to the 
command I want to run. When I accidentally run emerge --resume as a normal 
user, it tracebacks when trying to do something root-ish 

Reproducible: Always
Steps to Reproduce:
1. start an emerge as root 
2. interrupt the emerge 
3. emerge --resume as normal user 
 
Actual Results:  
electronerd@sheila ~ $ emerge --resume 
*** Resuming merge... 
>>> emerge (1 of 21) sys-libs/db-4.2.52_p2-r1 to / 
Traceback (most recent call last): 
  File "/usr/bin/emerge", line 3204, in ? 
    mydepgraph.merge(portage.mtimedb["resume"]["mergelist"]) 
  File "/usr/bin/emerge", line 1868, in merge 
    
retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1,tree="porttree") 
  File "/usr/lib/portage/pym/portage.py", line 2505, in doebuild 
    shutil.rmtree(mysettings["T"]) 
  File "/usr/lib/python2.4/shutil.py", line 172, in rmtree 
    onerror(os.rmdir, path, sys.exc_info()) 
  File "/usr/lib/python2.4/shutil.py", line 170, in rmtree 
    os.rmdir(path) 
OSError: [Errno 13] Permission denied: '/var/tmp/portage/db-4.2.52_p2-r1/temp' 
 

Expected Results:  
electronerd@sheila ~ $ emerge --resume 
emerge: root access required. 
 

electronerd@sheila ~ $ emerge info  
Portage 2.0.53 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r3,  
2.6.14-gentoo-r1 x86_64)  
=================================================================  
System uname: 2.6.14-gentoo-r1 x86_64 AMD Athlon(tm) 64 Processor 3400+  
Gentoo Base System version 1.12.0_pre11  
distcc[12950] (dcc_set_trace_from_env) ERROR: failed to open  
logfile /var/log/distcc: Permission denied [disabled]  
ccache version 2.4 [enabled]  
dev-lang/python:     2.3.5, 2.4.2  
sys-apps/sandbox:    1.2.14  
sys-devel/autoconf:  2.13, 2.59-r7  
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1  
sys-devel/binutils:  2.16.91.0.3  
sys-devel/libtool:   1.5.20-r1  
virtual/os-headers:  2.6.11-r3  
ACCEPT_KEYWORDS="amd64 ~amd64"  
AUTOCLEAN="yes"  
CBUILD="x86_64-pc-linux-gnu"  
CFLAGS="-march=athlon64 -pipe -Os"  
CHOST="x86_64-pc-linux-gnu"  
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control"  
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d"  
CXXFLAGS="-march=athlon64 -pipe -Os"  
DISTDIR="/usr/portage/distfiles"  
FEATURES="autoconfig buildpkg ccache confcache digest distlocks nostrip  
sandbox sfperms strict userpriv usersandbox"  
GENTOO_MIRRORS="http://distfiles.gentoo.org  
http://distro.ibiblio.org/pub/linux/distributions/gentoo"  
MAKEOPTS="-j2"  
PKGDIR="/usr/portage/packages"  
PORTAGE_TMPDIR="/var/tmp"  
PORTDIR="/usr/portage"  
PORTDIR_OVERLAY="/usr/local/portage"  
SYNC="rsync://sarge.electronerdia.net/gentoo-portage"  
USE="amd64 X a52 aac aalib acl acpi aim alsa ared aredmem artworkextra asf  
audiofile avi bash-completion berkdb bitmap-fonts bl bonobo bzip2 bzlib cairo  
caps cddb cdparanoia cdr clanJavaScript clanVoice cli crypt css cups curl  
curlwrappers dba dbm dga directfb doc dpms dts dv dvb dvd dvdr dvdread  
dynagraph ecc edl eds elf emacs emboss encode erandom esd ethereal examples  
exif expat fam fame fbcon ffmpeg flac font-server foomaticdb fpx ftp gcj gd  
gdbm ggi gif gimpprint glibc-omitfp glitz glut gmp gnome gpm graphviz gs  
gstreamer gtk gtk2 gtkhtml guile hal howl hpn icq ieee1394 imagemagick imap  
imlib inifile insecure-savers ipv6 jabber jack jack-tmpfs java javascript  
jikes joystick jp2 jpeg jpeg2k junit kde kdeenablefinal kerberos ladcca lcms  
ldap libcaca libwww lirc lm_sensors logitech-mouse lzo lzw lzw-tiff mad  
maildir makecheck matroska mhash mikmod mime mjpeg mng motif mozcalendar  
mozdevelop mozilla mozsvg mozxmlterm mp3 mpeg mplayer musepack musicbrainz  
mysql mythtv nas ncurses net network nforce2 no-old-linux nptl nptlonly  
nsplugin numeric nvidia offensive ofx ogg oggvorbis ooo-kde openal openexr  
opengl oscar pam pcntl pcre pdflib pear perl php physfs pic plotutils pmu png  
posix povray ppds python qt quicktime quotes rdesktop readline real recode rpm  
rrdtool samba sasl sblive sdk sdl sensord session slang slp smux sndfile snmp  
soap sockets softmmu speex spell spl sql sqlite ssl stencil-buffer subversion  
svg sysfs sysvipc tcltk tcpd tetex tga theora tidy tiff tokenizer transcode  
truetype truetype-fonts type1-fonts udev unicode usb userlocales v4l v4l2 vcd  
videos visualization vorbis wmf wmv wxwindows xanim xface xine xml xml2 xmms  
xosd xpm xprint xrandr xscreensaver xsl xv xvid xvmc yahoo yv12 zeroconf zip  
zlib userland_GNU kernel_linux elibc_glibc"  
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-12-07 19:16:03 UTC
Created attachment 74278 [details, diff]
Trivial patch to catch --resume

Resume slips through the cracks of the action handling, mostly due to it being
in myopts and not myaction or myfiles.	Add a check where it normally slips
through to check for --resume in myopts as well.
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-12-21 08:13:06 UTC
Released in 2.1_pre1.