Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 83289 - Config protection does not work when emerging with ROOT set
Summary: Config protection does not work when emerging with ROOT set
Status: RESOLVED DUPLICATE of bug 52415
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-25 04:46 UTC by Martin von Gagern
Modified: 2005-10-09 04:53 UTC (History)
2 users (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 Martin von Gagern 2005-02-25 04:46:51 UTC
When emerging something with ROOT set to some other dir, files that should be config protected get overwritten without warning.


Reproducible: Always
Steps to Reproduce:

1. ROOT=/mirror emerge -K gradm
2. nano /mirror/etc/policy
3. ROOT=/mirror emerge -K gradm
     >>> Merging sys-apps/gradm-2.1.0 to /mirror/
     >>> /mirror/sbin/gradm
     >>> /mirror/etc/grsec/policy
     >>> Safely unmerging already-installed instance...
     --- !mtime obj /mirror/sbin/gradm
     --- cfgpro obj /mirror/etc/grsec/policy
   file gets overwritten
4. ROOT=/mirror emerge -C gradm
   file protected and kept
5. nano /mirror/etc/policy
6. ROOT=/mirror CONFIG_PROTECT=/mirror/etc emerge -K gradm
   file still gets overwritten

Actual Results:  
File gets overwritten at 3.

Expected Results:  
File protected at 3., changes saved to salternate filename

Or file deleted in 4. as well and protected in 6., so config protection is
consistently relative to / and not to ${ROOT}


Portage 2.0.51-r15 (hardened/x86/2.6, gcc-3.3.5, glibc-2.3.4.20040808-r1,
2.6.10-gentoo-r5 i686)
=================================================================
System uname: 2.6.10-gentoo-r5 i686 Intel(R) Xeon(TM) CPU 2.40GHz
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb 22 2005, 11:11:32)]
dev-lang/python:     2.3.4-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/local/kde/3.2/share/config /usr/local/share/config /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws /etc/gconf /etc/terminfo /etc/env.d"
FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks sandbox"
USE="acl afs apache2 berkdb caps crypt dlloader gdbm hardened hardenedphp innodb
ipv6 jpeg ldap libwww memlimit mysql ncurses nls oci8 odbc pam pdflib perl pic
pie png postgres python readline ssl tcpd tiff unicode x86 xml2 zlib linguas_de"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 1 James Le Cuirot gentoo-dev 2005-10-08 20:44:12 UTC
I can confirm that this is also happening to me. I wondered why I wasn't getting 
any etc-update requests. This is a pretty serious bug and this bug report is 
months old, please fix it!!
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-10-09 04:53:48 UTC
Nobody has addressed my issue with it yet. How to express the following?  
  
CONFIG_PROTECT="/etc"    (for "/")  
CONFIG_PROTECT="-/etc"   (for "${ROOT}")  
 

*** This bug has been marked as a duplicate of 52415 ***