Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 54053 - CONFIG_PROTECT does not work for symlinks
Summary: CONFIG_PROTECT does not work for symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: Bug
Depends on:
Blocks:
 
Reported: 2004-06-15 21:20 UTC by Kalin KOZHUHAROV
Modified: 2005-10-07 09:29 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 Kalin KOZHUHAROV 2004-06-15 21:20:18 UTC
While I was upgrading rp-pppoe I noticed it, but I think it is a genreal problem with all ebuilds.

The problem is that symlinks are not preserved under CONFIG_PROTECT, but overwritten instead.

In this speciffic case, restarting pppoe (or rebooting) would have rendered it not reachable form the Net. And it is locked in a server room...


Reproducible: Always
Steps to Reproduce:
1. cd /etc/ppp; rm pppoe.conf; touch provider.conf; ln -s provider.conf pppoe.conf
2. emerge rp-pppoe


Actual Results:  
# ll /etc/ppp/pppoe.conf
-rw-r--r--  1 root root 4795 Jun 16 13:08 /etc/ppp/pppoe.conf


Expected Results:  
# ll /etc/ppp/pppoe.conf
lrwxrwxrwx  1 root root 14 Jun 16 12:53 /etc/ppp/pppoe.conf -> provider.conf

I guess it is a small tweak in emerge's handling of files (to include symlinks),
but python is not a language I understand.
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2004-06-21 02:59:35 UTC
I remember fixing this a long time ago... You're certain that
nothing else made it's way into the equation here?

You can duplicate this on demand?
Comment 2 Kalin KOZHUHAROV 2004-06-21 03:28:29 UTC
I just reproduced it, the followig way:

sata root # cd /etc/ppp; rm pppoe.conf; touch provider.conf; ln -s provider.conf pppoe.conf
rm: cannot remove `pppoe.conf': No such file or directory
sata ppp # ll /etc/ppp/pppoe.conf
lrwxrwxrwx  1 root root 13 Jun 21 19:21 /etc/ppp/pppoe.conf -> provider.conf
sata ppp # emerge rp-pppoe -a

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] net-dialup/rp-pppoe-3.5-r1  +X  0 kB 

Total size of downloads: 0 kB

Do you want me to merge these packages? [Yes/No] 
>>> emerge (1 of 1) net-dialup/rp-pppoe-3.5-r1 to /

[snip]

mkdir -p /var/tmp/portage/rp-pppoe-3.5-r1/image//etc/ppp
mkdir -p /var/tmp/portage/rp-pppoe-3.5-r1/image//etc/ppp/plugins
echo "# Directory created by rp-pppoe for kernel-mode plugin" > /var/tmp/portage/rp-pppoe-3.5-r1/image//etc/ppp/plugins/README
# L2TP

Type 'adsl-setup' to configure the software.
gzipping doc: CHANGES

[snip]

--- /etc/
--- /etc/ppp/
>>> /etc/ppp/plugins/
>>> /etc/ppp/plugins/README
>>> /etc/ppp/pppoe.conf
>>> /etc/ppp/firewall-standalone
>>> /etc/ppp/firewall-masq
>>> /etc/ppp/pppoe-server-options
>>> /etc/ppp/rp-pppoe-gui/
--- /etc/init.d/
>>> /etc/init.d/rp-pppoe
 * Use adsl-setup to configure your dialup connection
 * Caching service dependencies...
>>> net-dialup/rp-pppoe-3.5-r1 merged.
>>> Recording net-dialup/rp-pppoe 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.

sata ppp # ll /etc/ppp/pppoe.conf
-rw-r--r--  1 root root 4795 Jun 21 19:22 /etc/ppp/pppoe.conf
sata ppp # portageq config-protect 
/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/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/qmail/control
sata ppp # portageq config_protect_mask
/etc/gconf /etc/terminfo /etc/env.d
sata ppp # emerge -V
Portage 2.0.50-r8 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-KK1_sata)


Yes, I think I can reproduce it every time. Tell me what you need to debug.
Comment 3 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-07-28 21:43:27 UTC
If you can reproduce this with a stable portage please re-open.
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-07-29 04:45:46 UTC
I have a feeling this bug still exists. Did you try reproducing it before 
closing it? 
Comment 5 Kalin KOZHUHAROV 2005-07-29 08:44:14 UTC
Well, at least for me, it seems OK now.

# emerge -V
Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.5-r0, 2.6.11.10-fbks i686)

Tried my suggested test and with the above portage and
net-dialup/rp-pppoe-3.5-r11 it didn't overwrite the symlink. (pppoe didn't
install it's default /etc/ppp/pppoe.conf because of that, but that is another
story. At least I didn't loose data).

Jason, can you provide a test case that supports your feeling? (BTW, I have this
feeling too, just that I cannot prove it now). If not, we'd better close this one.
Comment 6 Jason Stubbs (RETIRED) gentoo-dev 2005-10-07 09:29:41 UTC
Nope. My feeling came from a similar bug with dispatch-conf.