Bug 1208402

Summary: Mark web.xml in tomcat-admin-webapps as config file
Product: Red Hat Enterprise Linux 7 Reporter: Hisanobu Okuda <hokuda>
Component: tomcatAssignee: Coty Sutherland <csutherl>
Status: CLOSED ERRATA QA Contact: fgoldefu
Severity: unspecified Docs Contact: Lucie Vařáková <lmanasko>
Priority: medium    
Version: 7.1CC: hokuda, ileppala, mbabacek, rhatlapa
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Update for marking tomcat-admin-webapps package configration files Previously, the _tomcat-admin-webapps_ `web.xml` files were not marked as the configuration files. Consequently, upgrading the _tomcat-admin-webapps_ package overwrote the `/usr/share/tomcat/webapps/host-manager/WEB-INF/web.xml` and `/usr/share/tomcat/webapps/manager/WEB-INF/web.xml` files, causing custom user configuration to be automatically removed. This update fixes classification of these files, thus preventing this problem.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 21:08:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1203710, 1298191, 1313485    

Description Hisanobu Okuda 2015-04-02 07:50:07 UTC
Description of problem:
Upgrading the tomcat-admin-webapps package overwrites the following 2 files:-

%{appdir}/host-manager/WEB-INF/web.xml
%{appdir}/manager/WEB-INF/web.xml

When these files are modified, yum update should not overwrite them. Just in case the files are modified, please mark the files as config adding the following 2 lines into tomcat.spec:-

%config(noreplace) %{appdir}/host-manager/WEB-INF/web.xml
%config(noreplace) %{appdir}/manager/WEB-INF/web.xml


Version-Release number of selected component (if applicable):

tomcat-admin-webapps-7.0.54-1.el7.noarch.rpm

How reproducible:


Steps to Reproduce:
1. yum update tomcat
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 ileppala 2015-08-18 06:33:44 UTC
We are also suffering from this issue. (RHEL 7)

Steps to Reproduce:
1. yum update tomcat

Actual results:
The following config files got overwritten
%{appdir}/host-manager/WEB-INF/web.xml
%{appdir}/manager/WEB-INF/web.xml

Expected results:
The new configuration files should be
%{appdir}/host-manager/WEB-INF/web.xml.rpmnew
%{appdir}/manager/WEB-INF/web.xml.rpmnew


Additional info:
This is already working in the tomcat package:
rpm -q -c tomcat
...
/etc/tomcat/web.xml

So it is already known that the file is a configuration file.

Comment 3 Coty Sutherland 2015-11-10 19:35:58 UTC
*** Bug 1211109 has been marked as a duplicate of this bug. ***

Comment 5 Coty Sutherland 2016-01-19 15:30:31 UTC
This behavior is intentional. Sometimes security updates affect the manager webapps web.xml and those changes need to be put in place. The config is overwritten to accept security updates instead of omitting them causing the user's installation to be vulnerable until the user manually updates them.

An option to override this behavior would be to use a yum-post-transaction action to overwrite the updated web.xml with your web.xml.rpmsave file. Note that this may cause you to miss security updates to the manager app's web.xml.

Comment 6 Hisanobu Okuda 2016-01-21 01:40:21 UTC
Coty, Thank you for your suggestion. I second what you mentioned. Security should have priority. However, the current rpm just overwrites the web.xml files and does not make .rpmsave files. I think it is a bad idea because changes are lost upgrading the package. Please consider marking them as %config (...not %config(noreplace)...) so that .saverpm files are made.

Comment 7 Coty Sutherland 2016-01-21 14:30:26 UTC
That I can do :) Sorry about that; I made an assumption.

Actually, it's marked as config(noreplace) for tomcat6 in rhel-6. Let me see if the fedora tomcat maintainer has an opinion on the topic and if we removed that from the spec intentionally.

Comment 8 Coty Sutherland 2016-06-02 12:47:24 UTC
The rhel-6.7 release addressed this issue in https://bugzilla.redhat.com/1054817. After further investigation into potential security issues, I see that only one CVE listed in the upstream security documentation for all three currently supported versions of tomcat updated the web.xml of the manager/host-manager application (CVE-2015-5351). Even though it was only one recently, I still think that it is a legitimate security concern, so instead of going along with the fix from rhel-6 I'm going to mark the manager/host-manager application's web.xml as config, not config(noreplace). If a user updates tomcat and needs to put their changes back in place, they can simply copy the .rpmsave file back over the web.xml thereby taking responsibility for checking the web.xml for updates.

Comment 15 errata-xmlrpc 2016-11-03 21:08:28 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.

https://rhn.redhat.com/errata/RHSA-2016-2599.html