Bug 494434 - %config(noreplace) and modes and ownership not applied in .rpmnew scenarios
Summary: %config(noreplace) and modes and ownership not applied in .rpmnew scenarios
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 15
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-06 20:43 UTC by Ville Skyttä
Modified: 2012-08-06 20:01 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ville Skyttä 2009-04-06 20:43:16 UTC
# rpm -q rpm
rpm-4.6.0-1.fc10.x86_64

If a %config(noreplace) file entry results in the new one saved as .rpmnew, I think it's reasonable to expect that modes and ownership from the new entry would be still applied to the old config file whose contents were left untouched.

Example specfiles at http://scop.fedorapeople.org/bugs/noreplace-perms/

# rpm -i noreplace-perms-1.0-1.x86_64.rpm
# echo foo >> /tmp/noreplace-perms
# rpm -U noreplace-perms-1.1-1.x86_64.rpm
warning: /tmp/noreplace-perms created as /tmp/noreplace-perms.rpmnew
# ls -l /tmp/noreplace-perms*
-rw-r--r-- 1 root   root   8 2009-04-06 23:37 /tmp/noreplace-perms
-rw-r----- 1 apache apache 4 2009-04-06 23:37 /tmp/noreplace-perms.rpmnew

I would have hoped/expected that /tmp/noreplace-perms in addition to /tmp/noreplace-perms.rpmnew would have had 0640 apache:apache permissions after this operation.  Not getting the permissions applied on upgrade scenarios like these might be kind of a security issue if the permissions were changed for a security related reason and this bug/missing feature is not taken care of manually chmod/chowning in package scriptlets.

Comment 1 Jeff Johnson 2009-04-09 19:21:41 UTC
And if the sysadmin has deliberately chosen different
ownership/access you want rpm to 2nd guess what the
sysadmin has chosen to do for %config(noreplace) files?

That makes no sense to me, but have fun!

Comment 2 Ville Skyttä 2009-04-09 20:21:44 UTC
rpm already quite happily changes permissions of config files on upgrades when no .rpmnew needs to be generated.

Comment 3 Jeff Johnson 2009-04-09 20:28:25 UTC
Yes, on files that the sysadmin has not altered. Your comment is irrelevant
to your original RFE.

Comment 4 Ville Skyttä 2009-04-09 21:47:15 UTC
(In reply to comment #3)
> Yes, on files that the sysadmin has not altered.

It does it on upgrades also for files which the sysadmin _has_ altered by changing the files' permissions.

# rpm -i noreplace-perms-1.0-1.x86_64.rpm
# ls -l /tmp/noreplace-perms
-rw-r--r-- 1 root root 4 2009-04-10 00:33 /tmp/noreplace-perms
# chown bin:bin /tmp/noreplace-perms ; chmod 400 /tmp/noreplace-perms
# ls -l /tmp/noreplace-perms
-r-------- 1 bin bin 4 2009-04-10 00:33 /tmp/noreplace-perms
# rpm -U noreplace-perms-1.1-1.x86_64.rpm
# ls -l /tmp/noreplace-perms
-rw-r----- 1 apache apache 4 2009-04-10 00:35 /tmp/noreplace-perms

> Your comment is irrelevant to your original RFE.

I disagree.  To summarize differently, this RFE is about consistent behavior wrt. what happens to permissions of actual/effective (not .rpm* backups) config files on package upgrades.

Comment 5 Jeff Johnson 2009-04-09 22:00:41 UTC
If file stat(2) changes are not detected (and .rpmnew suffix
appended for %config(noreplace)), then the flaw is in rpm-4.6.0
changing %config handling or other bug, not otherwise. The behavior
peculier to rpm-4.6.0, as will be the RFE here if actually
implemented.

Most certainly we disagree whether sysadmin changes
to *.rpm files should be respected or whether *.rpm
should blindly attempt to guess what to do. The disagreement
is easily detected in comment #3 (now spelled out in detail).

Have fun!

Comment 6 Bug Zapper 2009-11-18 09:12:29 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Ville Skyttä 2009-11-18 22:11:03 UTC
Applies to rpm-4.7.1-3.fc11.x86_64 too.

Comment 8 Bug Zapper 2010-04-27 13:31:53 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Ville Skyttä 2010-04-29 21:20:07 UTC
(In reply to comment #7)
> Applies to rpm-4.7.1-3.fc11.x86_64 too.    

Ditto rpm-4.8.0-14.fc13.x86_64.

Comment 10 Bug Zapper 2011-06-02 18:09:59 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 11 Ville Skyttä 2011-06-10 21:20:23 UTC
rpm-4.9.0-6.fc15.x86_64 is affected.

Comment 12 Fedora End Of Life 2012-08-06 20:00:45 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 15. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 15 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 13 Fedora End Of Life 2012-08-06 20:01:27 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 15. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 15 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.