Bug 1115406 - Neutron packaging attempts to update sudoers config file avoiding usual procedure
Summary: Neutron packaging attempts to update sudoers config file avoiding usual proce...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-neutron
Version: 4.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: async
: 4.0
Assignee: Ihar Hrachyshka
QA Contact: Ofer Blaut
URL:
Whiteboard:
Depends On:
Blocks: 1115408 1115410
TreeView+ depends on / blocked
 
Reported: 2014-07-02 10:02 UTC by Ihar Hrachyshka
Modified: 2016-04-27 05:50 UTC (History)
8 users (show)

Fixed In Version: openstack-neutron-2013.2.3-14.el6ost
Doc Type: Bug Fix
Doc Text:
With this update, Networking (neutron) packages now update the '/etc/sudoers.d/neutron' file. Consequently, any local changes have been relocated to the '/etc/sudoers.d/neutron.rpmsave' file, and will need to be merged back manually. To avoid the need for manual updates in future, please apply local changes in a separate 'sudoers.d' file.
Clone Of:
: 1115408 1115410 (view as bug list)
Environment:
Last Closed: 2014-07-17 04:28:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0899 0 normal SHIPPED_LIVE Moderate: openstack-neutron security, bug fix, and enhancement update 2014-07-17 08:28:02 UTC

Description Ihar Hrachyshka 2014-07-02 10:02:33 UTC
Description of problem:

In neutron spec, we have the following 'magic fix' for incorrect sudoers file:

%postun
...
    # Fix sudoers file on old installations
    sed -i 's/^neutron ALL = (root) NOPASSWD: SETENV: \/usr\/bin\/neutron-rootwrap$/neutron ALL = (root) NOPASSWD: \/usr\/bin\/neutron-rootwrap \/etc\/neutron\/ro
...

This is to enforce update for sudoers file that had a security issue before bug 1039817 was fixed.

This 'magic fix' makes TPS test fail as in: http://nest.test.redhat.com/mnt/qa/scratch/stable-rhos5-rhel6-01/2014:17999/tps/tps-rpmtest.html

The sudoers file is a config file with 'noreplace' tag, meaning that it's not replaced on package update in case that it was touched by a user. In that case, an .rpmnew file is created, and a user is expected to merge new changes back to the config file. We should not change that. So the fix cited above should be removed.

Steps to Reproduce:
- install openstack-neutron-2013.2.1-1 or earlier.
- modify /etc/sudoers.d/neutron.
- upgrade it to openstack-neutron-2013.2.1-2.
- check that /etc/sudoers.d/neutron was modified on package update.

Expected results:
- /etc/sudoers.d/neutron should not be touched on package update. Instead, .rpmnew file is created, and a user is expected to update the config file manually.

Comment 1 Ihar Hrachyshka 2014-07-02 10:10:56 UTC
I've marked that bug for 'async' release because it blocks errata process for another CVE bug that is also async: https://bugzilla.redhat.com/show_bug.cgi?id=1108549

Comment 2 Ihar Hrachyshka 2014-07-02 11:35:41 UTC
FYI the issue is not present in all branches for RDO.

Comment 3 Alan Pevec 2014-07-02 14:31:37 UTC
> Expected results:
> - /etc/sudoers.d/neutron should not be touched on package update. Instead,
> .rpmnew file is created, and a user is expected to update the config file
> manually.

Expected result should be:
(for argumentation see bug 1039817 comment 16)
- /etc/sudoers.d/neutron should updated with the new RPM content, ensuring security issue is fixed
- .rpmsave file is created in case there were local changes, user is expected to use separate sudoers file for custom changes

Comment 4 Ihar Hrachyshka 2014-07-02 15:08:07 UTC
OK, we've had IRC discussion with both Neutron team and Alan, and we're now more keen to just drop that 'noreplace' tag, meaning any local changes to the file will be moved to .rpmsave on update. Moving back to ON_DEV to update spec for the new behaviour.

Comment 5 Ihar Hrachyshka 2014-07-02 15:47:00 UTC
FYI Terry Wilson was concerned about removing 'noreplace' from the file because it may result in unexpected changes to user's config files in case they modified sudoers.d/neutron. We should make it explicit that package update will require merging changes from .rpmsave, if any. See doc text for example of the description.

Comment 7 Lon Hohberger 2014-07-15 16:56:03 UTC
Note that the expected behavior of the changes from this bugzilla only take place when upgrading from openstack-neutron-2013.2.3-14.el6ost to a later version of the package.

Previous packages (for example openstack-neutron-2013.2.3-14.el6ost) have a 'sed' in the %postun scriptlet.  RPM ordering means that the *new* neutron sudoers file is edited/touched by this sed script after the installation of the new package has completed, causing a timestamp mismatch after installation (if checked with 'rpm -V'.

When upgrading from -14 to a later package, it's likely users will have to remove /etc/sudoers.d/neutron prior to updating the openstack-neutron package unless the contents of /etc/sudoers.d/neutron changes.

Comment 10 errata-xmlrpc 2014-07-17 04:28:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-0899.html


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