Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] portage overwriting protected files?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
huuan
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 265
Location: California

PostPosted: Fri Jan 04, 2013 8:15 am    Post subject: [SOLVED] portage overwriting protected files? Reply with quote

One of the things I really love about Gentoo is CONFIG_PROTECT and dispatch-conf
This evening when updating php 5.3 and php 5.4 I noticed the message at the end that said
Quote:
* Configuration file installed as
* /etc/apache2/modules.d/70_mod_php5.conf


I found that a little disturbing as I'm used to messages after emerge telling me there are config files that need updating and then I run dispatch-conf for the updates.

so I took a look at what was changed in /etc/php
and found this as well
Code:
$ ls -rlt apache2-php5.4/php.ini
-rw-r--r-- 1 root root 66953 Jan  3 22:17 apache2-php5.4/php.ini


Using diff on saved versions of these I don't see any actual differences from before and perhaps I'm being paranoid but my CONFIG_PROTECT should be preventing portage from overwriting /etc/apache2/* and /etc/php/apache2-php5.4/php.ini as far as I can tell:

here the pertinent excerpt from my emerge --info
Code:
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"


So how come portage is touching those files even though CONFIG_PROTECT says it shouldn't?


Last edited by huuan on Sat Jan 05, 2013 5:54 am; edited 2 times in total
Back to top
View user's profile Send private message
zmedico
Developer
Developer


Joined: 02 Jan 2004
Posts: 352
Location: California USA

PostPosted: Fri Jan 04, 2013 8:53 am    Post subject: Reply with quote

Maybe it's related to the config-protect-if-modified FEATURES setting.
_________________
Zac
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Fri Jan 04, 2013 1:17 pm    Post subject: Reply with quote

Another possibility could be that some of the path elements is a symlink.
Back to top
View user's profile Send private message
huuan
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 265
Location: California

PostPosted: Sat Jan 05, 2013 4:59 am    Post subject: Reply with quote

zmedico wrote:
Maybe it's related to the config-protect-if-modified FEATURES setting.

That might be it. Guess I never understood the implications of this before.
Quote:
This causes the CONFIG_PROTECT behavior to be skipped
for files that have not been modified since they were installed.


Does this mean it is OK to overwrite a config file that has never been modified?
It leaves me to wonder what was wrong with the previous behavior. I was very happy with the way portage worked but I guess it wasn't doing something and so causing some problem.
Thanks for your insight.
Back to top
View user's profile Send private message
zmedico
Developer
Developer


Joined: 02 Jan 2004
Posts: 352
Location: California USA

PostPosted: Sat Jan 05, 2013 5:06 am    Post subject: Reply with quote

huuan wrote:
zmedico wrote:
Maybe it's related to the config-protect-if-modified FEATURES setting.

That might be it. Guess I never understood the implications of this before.
Quote:
This causes the CONFIG_PROTECT behavior to be skipped
for files that have not been modified since they were installed.

Does this mean it is OK to overwrite a config file that has never been modified?

Right.
huuan wrote:
It leaves me to wonder what was wrong with the previous behavior. I was very happy with the way portage worked but I guess it wasn't doing something and so causing some problem.

If you disable config-protect-if-modified then CONFIG_PROTECT will trigger for lots of files that you may not care about. To most people, those config updates are mostly just a bunch of useless noise.
_________________
Zac
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Jan 05, 2013 5:39 am    Post subject: Reply with quote

To elaborate on zmedico's statement, with the old behavior, if the upstream project changed the defaults in their configuration file, you would be prompted to accept or reject those changes, even if you had never even opened the file before and you were perfectly happy to use whatever defaults upstream had picked. Now, you are only notified if there is a chance that silently overwriting would erase local customizations.
Back to top
View user's profile Send private message
huuan
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 265
Location: California

PostPosted: Sat Jan 05, 2013 5:47 am    Post subject: Reply with quote

Thanks Zac and Hu for the lucid explanations. :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum