Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 153951 - Running ebuild <ebuild> merge as a non-root user gives traceback
Summary: Running ebuild <ebuild> merge as a non-root user gives traceback
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 147007
  Show dependency tree
 
Reported: 2006-11-03 10:42 UTC by Petteri Räty (RETIRED)
Modified: 2008-12-31 14:42 UTC (History)
1 user (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 Petteri Räty (RETIRED) gentoo-dev 2006-11-03 10:42:07 UTC
Running ebuild <ebuild> merge should of course not be posssible as a normal user. We should detect this during option parsing and tell this to the user.

betelgeuse@pena /mnt/checkouts/overlays/migrated-java/dev-java/jlayer $ devebuild jlayer-1.0.ebuild clean merge
Disabling noauto in features... merge disables it. (qmerge doesn't)
 * jlayer1.0.tar.gz MD5 ;-) ...                                                                                                                                                                        [ ok ]
 * jlayer1.0.tar.gz RMD160 ;-) ...                                                                                                                                                                     [ ok ]
 * jlayer1.0.tar.gz SHA1 ;-) ...                                                                                                                                                                       [ ok ]
 * jlayer1.0.tar.gz SHA256 ;-) ...                                                                                                                                                                     [ ok ]
 * jlayer1.0.tar.gz size ;-) ...                                                                                                                                                                       [ ok ]
 * Using: sun-jdk-1.5
>>> Unpacking source...
>>> Unpacking jlayer1.0.tar.gz to /var/tmp/portage/dev-java/jlayer-1.0/work
tar: A lone zero block at 4106
removed `jl1.0.jar'
>>> Source unpacked.
Rewriting ./build.xml
>>> Compiling source in /var/tmp/portage/dev-java/jlayer-1.0/work/JLayer1.0 ...
 * Disabling system classpath for ant
Buildfile: build.xml

init:
     [echo] -------------------------------------------------------------
     [echo] ------------         BUILDING JLAYER PACKAGE       ----------


build:
     [echo] ------ Compiling application

dist:
     [echo] ------ Building Jar file
      [jar] Building jar: /var/tmp/portage/dev-java/jlayer-1.0/work/JLayer1.0/jl1.0.jar

BUILD SUCCESSFUL
Total time: 1 second
>>> Source compiled.
>>> Test phase [not enabled]: dev-java/jlayer-1.0

>>> Install jlayer-1.0 into /var/tmp/portage/dev-java/jlayer-1.0/image/ category dev-java
install: cannot change ownership of `/var/tmp/portage/dev-java/jlayer-1.0/image//usr/bin/jl-converter': Operation not permitted
install: cannot change ownership of `/var/tmp/portage/dev-java/jlayer-1.0/image//usr/bin/jl-player': Operation not permitted
install: cannot change ownership of `/var/tmp/portage/dev-java/jlayer-1.0/image//usr/bin/jl-advanced-player': Operation not permitted
>>> Completed installing jlayer-1.0 into /var/tmp/portage/dev-java/jlayer-1.0/image/

man:
Traceback (most recent call last):
  File "/usr/bin/ebuild", line 114, in ?
    debug=debug, tree=mytree)
  File "/usr/lib/portage/pym/portage.py", line 3186, in doebuild
    vartree=vartree, prev_mtimes=prev_mtimes)
  File "/usr/lib/portage/pym/portage.py", line 3387, in merge
    mydbapi=mydbapi, prev_mtimes=prev_mtimes)
  File "/usr/lib/portage/pym/portage.py", line 6814, in merge
    cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes)
  File "/usr/lib/portage/pym/portage.py", line 6246, in treewalk
    self.lockdb()
  File "/usr/lib/portage/pym/portage.py", line 5899, in lockdb
    self.lock_pkg = portage_locks.lockdir(self.dbpkgdir)
  File "/usr/lib/portage/pym/portage_locks.py", line 21, in lockdir
    return lockfile(mydir,wantnewlockfile=1)
  File "/usr/lib/portage/pym/portage_locks.py", line 53, in lockfile
    myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660)
OSError: [Errno 13] Permission denied: '/var/db/pkg/dev-java/jlayer-1.0.portage_lockfile'

betelgeuse@pena /mnt/checkouts/overlays/migrated-java/dev-java/jlayer $ emerge --info
Portage 2.1.2_rc1-r3 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.18-gentoo i686)
=================================================================
System uname: 2.6.18-gentoo i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.12.6
Last Sync: Unknown
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -mfpmath=sse -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -pipe -mfpmath=sse -fomit-frame-pointer"
DISTDIR="/var/distfiles"
FEATURES="autoaddcvs autoconfig ccache collision-protect cvs distlocks fixpackages java-strict parallel-fetch sandbox sfperms sign strict stricter userpriv usersandbox verify-rdepend"
GENTOO_MIRRORS=" http://trumpetti.atm.tut.fi/gentoo  http://lame.lut.fi/linux/gentoo "
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="fi"
MAKEOPTS="-j2 -s"
PKGDIR="/home/pkg/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/mnt/checkouts/overlays/betelgeuse /mnt/checkouts/overlays/xgl-overlay /mnt/checkouts/overlays/migrated-java /mnt/checkouts/overlays/java-experimental /mnt/checkouts/overlays/portage-xgl /mnt/checkouts/overlays/sunrise /mnt/checkouts/overlays/voip"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 aac acl acpi alsa arts audiofile bash-completion berkdb bitmap-fonts bluetooth bzip2 cairo cdb cddb cdparanoia cdr cli cracklib crypt cups dbus dlloader dri dts dvd dvdr dvdread elibc_glibc emboss esd fam ffmpeg firefox gif gstreamer hal iconv input_devices_keyboard input_devices_mouse isdnlog java jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux libg++ linguas_fi logitech-mouse mad mikmod mjpeg mmx mp3 mpeg ncurses network nptl nptlonly nsplugin nvidia offensive ogg opengl pam pcre png ppds pppd qt3 quicktime readline real reflection rtc samba session spell spl sse sse2 ssl subversion svg symlink tcpd theora threads truetype truetype-fonts type1-fonts udev unicode usb userland_GNU userlocales video_cards_none video_cards_nvidia vorbis xcomposite xinerama xml xorg xv xvid xvmc zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2006-11-03 10:48:40 UTC
we should catch the traceback but i dont think disallowing a non-root user to run the merge operation should be added ...

cant you utilize $ROOT as a non-root user and merge files just fine ?
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2006-11-03 10:56:37 UTC
(In reply to comment #1)
> we should catch the traceback but i dont think disallowing a non-root user to
> run the merge operation should be added ...
> 
> cant you utilize $ROOT as a non-root user and merge files just fine ?
> 

You are likely right here.
Comment 3 Zac Medico gentoo-dev 2006-11-03 12:37:44 UTC
In svn r4916, I've fixed it to fail with a simple "Permission denied" error if the merge phase doesn't have write access to $ROOT.
Comment 4 Zac Medico gentoo-dev 2006-11-05 23:40:32 UTC
This has been released in 2.1.2_rc1-r4.