Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116511 - portage: collision-protect doesn't protect against overwriting of symlinks
Summary: portage: collision-protect doesn't protect against overwriting of symlinks
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL: http://article.gmane.org/gmane.linux....
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 115839
  Show dependency tree
 
Reported: 2005-12-23 10:44 UTC by Harald van Dijk (RETIRED)
Modified: 2006-01-27 19:25 UTC (History)
0 users

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


Attachments
Treat symlinks like regular files (sym-like-obj.patch,3.12 KB, patch)
2005-12-23 10:48 UTC, Jason Stubbs (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk (RETIRED) gentoo-dev 2005-12-23 10:44:16 UTC
This is with portage-2.1_pre1:

$ cd /etc/portage/overlay/test
$ cat test/test-1.0.ebuild 
KEYWORDS="~x86"
src_install() {
        dodir /test
        dosym /usr/bin /test/sym
}
$ cat test2/test2-1.0.ebuild
KEYWORDS="~x86"
src_install() {
        dodir /test
        dosym /usr/bin /test/sym
}
$ sudo env FEATURES=collision-protect emerge test/test test/test2
Calculating dependencies ...done!
>>> emerge (1 of 2) test/test-1.0 to /
>>> md5 files   ;-) test-1.0.ebuild
>>> md5 files   ;-) files/digest-test-1.0
>>> Unpacking source...
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/test-1.0 ...
>>> Source compiled.
>>> Test phase [not enabled]: test/test-1.0

>>> Install test-1.0 into /var/tmp/portage/test-1.0/image/ category test
man:
prepallstrip:
>>> Completed installing test-1.0 into /var/tmp/portage/test-1.0/image/

* checking 0 files for package collisions
* spent 0.000245094299316 seconds checking for file collisions
>>> Merging test/test-1.0 to /
>>> /test/
>>> /test/sym -> /usr/bin
>>> Regenerating /etc/ld.so.cache...
>>> test/test-1.0 merged.
>>> Recording test/test in "world" favorites file...

>>> clean: No packages selected for removal.

>>> emerge (2 of 2) test/test2-1.0 to /
>>> md5 files   ;-) test2-1.0.ebuild
>>> md5 files   ;-) files/digest-test2-1.0
>>> Unpacking source...
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/test2-1.0 ...
>>> Source compiled.
>>> Test phase [not enabled]: test/test2-1.0

>>> Install test2-1.0 into /var/tmp/portage/test2-1.0/image/ category test
man:
prepallstrip:
>>> Completed installing test2-1.0 into /var/tmp/portage/test2-1.0/image/

* checking 0 files for package collisions
* spent 0.00157403945923 seconds checking for file collisions
>>> Merging test/test2-1.0 to /
--- /test/
>>> /test/sym -> /usr/bin
>>> Regenerating /etc/ld.so.cache...
>>> test/test2-1.0 merged.
>>> Recording test/test2 in "world" favorites file...

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


 * GNU info directory index is up-to-date.

$ emerge --info
Portage 2.1_pre1 (default-linux/x86/2005.1, gcc-4.0.2, glibc-2.3.6-r1, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 AMD Duron(tm) Processor
Gentoo Base System version 1.12.0_pre12
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.17
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.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /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/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=athlon-tbird -O2 -pipe"
DISTDIR="/var/dist"
FEATURES="autoconfig collision-protect cvs distlocks noauto notitles sandbox sfperms sign strict"
GENTOO_MIRRORS="                http://ftp.easynet.nl/mirror/gentoo             http://distfiles.gentoo.org   "
LANG="en_GB.UTF-8"
LINGUAS="en en_GB ja nl"
PKGDIR="/var/pkg"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/cvs/gentoo-x86"
PORTDIR_OVERLAY="/etc/portage/overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X acl apm asf audiofile avi bidi bitmap-fonts bzip2 cdparanoia cjk crypt css cups dlloader dri dvdread emboss encode exif expat fam ffmpeg firefox ftp gif gpgme gtk gtk2 idn imagemagick imlib immqt ipv6 ithreads jpeg kde kdeenablefinal lcms libg++ libwww linuxthreads-tls lynxkeymap mbox mmx mng mozdevelop mozsvg mpeg mplayer ncurses nethack nls noamazon nocxx nopie nossp nowebdav nptl offensive ogg oggvorbis openal opengl oss pcre pdflib pic png ppds quicktime readline real reiser4 rtc sdl slang spell ssl tetex threads tiff truetype truetype-fonts type1-fonts udev unicode userlocales vorbis win32codecs xine xml2 xmms xv xvid zlib elibc elibc_glibc kernel kernel_linux linguas linguas_en linguas_en_GB linguas_ja linguas_nl userland userland_GNU video_cards video_cards_radeon"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, MAKEOPTS

Please let me know if you need any extra details.
Comment 1 Jason Stubbs (RETIRED) gentoo-dev 2005-12-23 10:48:37 UTC
Created attachment 75401 [details, diff]
Treat symlinks like regular files

Have confirmed that collision-protect doesn't take effect.

There's also a secondary(primary?) issue in that unmerging either or both of test and test2 will not remove /test or /test/sym. The attached patch fixes that issue.
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-12-25 00:12:33 UTC
2.1_pre2 uses mtimes to decide whether to unmerge symlinks. collision-protect hasn't been updated yet.
Comment 3 Jason Stubbs (RETIRED) gentoo-dev 2005-12-30 23:28:55 UTC
Released in portage-2.1_pre3
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2006-01-27 19:25:35 UTC
Released in 2.1_pre4