Bug 886653
| Summary: | Tomcat6 files should be owned by user / group tomcat | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | michael.jang | ||||||||
| Component: | tomcat6 | Assignee: | Coty Sutherland <csutherl> | ||||||||
| Status: | CLOSED ERRATA | QA Contact: | Bogdan Sikora <bsikora> | ||||||||
| Severity: | low | Docs Contact: | |||||||||
| Priority: | unspecified | ||||||||||
| Version: | 6.2 | CC: | fgoldefu, mark.craig, michael, pslavice, rwilliam | ||||||||
| Target Milestone: | rc | ||||||||||
| Target Release: | --- | ||||||||||
| Hardware: | x86_64 | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2016-05-11 00:06:14 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: | 1275725 | ||||||||||
| Attachments: |
|
||||||||||
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. FYI, I see that for RHEL 7, Tomcat files are now owned by group tomcat. I suspect the same solution should work for RHEL 6.x. I walked through the steps to see exactly what was wrong here. This one is a bit odd. Deploying the nightly build and attempting to access it redirects me to http://rhel6:8080/OpenAM-13.0.0-SNAPSHOT/nowritewarning.jsp with the warning that it doesn't have write access to /usr/share/tomcat (as stated in the description). It looks like the webapps dir permission is OK: +++ # ll /var/lib/tomcat6/webapps/ total 122584 drwxr-xr-x. 10 root tomcat 4096 Dec 16 14:46 docs drwxrwxr-x. 5 root tomcat 4096 Dec 16 14:46 examples drwxrwxr-x. 5 root tomcat 4096 Dec 16 14:46 host-manager drwxrwxr-x. 5 root tomcat 4096 Dec 16 14:46 manager drwxr-xr-x. 23 tomcat tomcat 4096 Dec 16 15:14 OpenAM-13.0.0-SNAPSHOT -rw-r--r--. 1 root root 125490314 Dec 16 15:13 OpenAM-13.0.0-SNAPSHOT.war drwxrwxr-x. 3 root tomcat 4096 Dec 16 14:46 ROOT drwxrwxr-x. 5 root tomcat 4096 Dec 16 14:46 sample +++ but it can't access it through the symlink: +++ # ll /usr/share/tomcat6/ total 4 drwxr-xr-x. 2 root root 4096 Dec 16 14:46 bin lrwxrwxrwx. 1 root tomcat 12 Dec 16 14:46 conf -> /etc/tomcat6 lrwxrwxrwx. 1 root root 23 Dec 16 14:46 lib -> /usr/share/java/tomcat6 lrwxrwxrwx. 1 root root 16 Dec 16 14:46 logs -> /var/log/tomcat6 lrwxrwxrwx. 1 root root 23 Dec 16 14:46 temp -> /var/cache/tomcat6/temp lrwxrwxrwx. 1 root root 24 Dec 16 14:46 webapps -> /var/lib/tomcat6/webapps lrwxrwxrwx. 1 root root 23 Dec 16 14:46 work -> /var/cache/tomcat6/work +++ Chowning the /usr/share/tomcat6 directory to :tomcat works fine and matches what RHEL7 tomcat does. By the way, I'm testing with build 90: +++ # rpm -qa tomcat6* tomcat6-lib-6.0.24-90.el6.x86_64 tomcat6-admin-webapps-6.0.24-90.el6.x86_64 tomcat6-servlet-2.5-api-6.0.24-90.el6.x86_64 tomcat6-el-2.1-api-6.0.24-90.el6.x86_64 tomcat6-6.0.24-90.el6.x86_64 tomcat6-docs-webapp-6.0.24-90.el6.x86_64 tomcat6-javadoc-6.0.24-90.el6.x86_64 tomcat6-jsp-2.1-api-6.0.24-90.el6.x86_64 tomcat6-webapps-6.0.24-90.el6.x86_64 +++ Created attachment 1106735 [details]
proposed patch
Created attachment 1106757 [details]
proposed patch v2
The latest proposed patch (v2) corrects the permissions on /usr/share/tomcat6 and the ownership of a couple of sub-dirs. I did test with OpenAM also and it no longer redirects to the write permission jsp. Coty, thank you for your attention to this. It sounds like you've replicated my steps, seen what I see, and have set up a patch. While I haven't tested your patch, the changes look like what I'm asking for. Thank you. 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/RHBA-2016-0870.html |
Created attachment 662576 [details] Standard Tomcat6 Log File Description of problem: The Tomcat 6 RPM package, as built by Red Hat is not usable as a container, due to an ownership issue in the /usr/share/tomcat6 and the linked /var/lib/tomcat6/webapps directory. When a properly configured example.war archive is copied to the noted /var/lib/tomcat6/webapps directory while Tomcat is running, appropriate files are unpacked to the /var/lib/tomcat6/webapps/example directory, owned by user and group tomcat. This seems confirmed by the following message in catalina.out log file in the /var/lib/tomcat6 directory: Dec 11, 2012 3:36:30 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive openam.war However, the default ownership of the /usr/share/tomcat6, and the linked /var/lib/tomcat6/webapps directory is root.root. The result is that write access is not available to the application embedded in the .war archive. I believe this is a Red Hat issue, as this is not an issue for Apache Tomcat 6 as downloaded from tomcat.apache.org. A minimal “work around” grants group ownership of the following directories to the group tomcat: /usr/share/tomcat6 /usr/share/tomcat6/webapps (which is linked to /var/lib/tomcat6/webapps) (A more straightfoward “chown -R tomcat.tomcat /usr/share/tomcat6” also works for our purposes.) As Tomcat6 is run by the user tomcat, I believe it makes sense that associated directories should also be accessible to at least the group tomcat. I therefore request that Red Hat repackage the Tomcat6 RPM to configure ownership on appropriate directories to user tomcat. I note that the Tomcat6 service is run by user tomcat, and suggest that the owner of the directory and user configured to run the service should match. Version-Release number of selected component (if applicable): tomcat6-6.0.24-45.el6.noarch How reproducible: Steps to Reproduce: 1. Download and unpack the stable or nightly release of OpenAM from forgerock.org/openam.html 2. Copy an appropriate WAR file to the /usr/share/tomcat6/webapps directory, as openam.war 3. Make sure Tomcat is running, and confirm that it processes the openam.war file into a /usr/share/tomcat6/webapps/openam directory. 4. Attempt to configure OpenAM. Actual results: The OpenAM configuration is unable to complete, as it can't write to directories owned by root. Expected results: Configuration options should be writable to files and directories in /usr/share/tomcat6 and /usr/share/tomcat6/webapps. Additional info: In the interest of full disclosure, I now work for ForgeRock, and have also filed other bugs under a different account (to which I no longer seem to have access). What I’m reporting is based on my work with the ForgeRock OpenAM access management platform, using the Apache Tomcat 6 container as packaged for RHEL 6 / CentOS 6. This issue appears to be tangentially related to the following existing bugs: 831464, 834169 In addition, in this bug report, I speak only for myself.