RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 987590 - Apache startup fails with misleading error if DocumentRoot has context type user_home_t
Summary: Apache startup fails with misleading error if DocumentRoot has context type u...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: httpd
Version: 6.4
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: Filip Holec
URL:
Whiteboard:
Depends On:
Blocks: 1170220 1207093 1209547
TreeView+ depends on / blocked
 
Reported: 2013-07-23 18:09 UTC by Joe Thompson
Modified: 2021-01-14 09:34 UTC (History)
6 users (show)

Fixed In Version: httpd-2.2.15-40.el6
Doc Type: Bug Fix
Doc Text:
If "DocumentRoot" was a directory with the context type of "user_home_t", the httpd service failed to start with an incorrect error message "DocumentRoot must be a directory". As a consequence, the error message was misleading because the "DocumentRoot" was a directory but not readable because of SELinux context. The misleading error message has been altered, and httpd now shows a more informative error message "DocumentRoot is not a directory, or is not readable" in this scenario.
Clone Of:
: 1170220 1207093 1209547 (view as bug list)
Environment:
Last Closed: 2015-07-22 05:52:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1249 0 normal SHIPPED_LIVE Low: httpd security, bug fix, and enhancement update 2015-07-20 17:50:12 UTC

Description Joe Thompson 2013-07-23 18:09:57 UTC
Description of problem:

If DocumentRoot is a directory with the context type user_home_t, the httpd service fails to start up with the error "DocumentRoot must be a directory".  This is different from its behavior in other incorrect-context-type cases where it starts up successfully (but access to the content in question is still correctly denied).


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


How reproducible: 100%


Steps to Reproduce:

1. Create a directory in a user homedir or otherwise assign it a context as though it had been so created.
2. Move the directory to /
3. Configure Apache's DocumentRoot to point to this directory.
4. [Re]start httpd.

Actual results: httpd startup fails with a misleading error.


Expected results: httpd startup succeeds (matching its behavior in other such cases), or fails with an error that gives correct information.


Additional info:

It would be better if Apache just gave a generic but correct error message like "can't access DocumentRoot".  It would be better still if Apache considered the current enforcement status, and if SELinux is enforcing, reported something like "DocumentRoot is not a directory or SELinux is blocking access".  Best would be if it considered enforcement status, looked at the directory context and reported something like "DocumentRoot is inaccessible because of bad SELinux context: type is [foo] but must be [bar]".

I understand Fedora's FriendlyEPERM effort has a similar goal:

https://fedoraproject.org/wiki/Features/FriendlyEPERM

However, for RHEL 6 it is probably better to address this case-by-case without reliance on FriendlyEPERM.

Comment 1 Joe Orton 2013-07-24 09:53:17 UTC
Thanks for the report, seems reasonable.  

http://svn.apache.org/viewvc?view=revision&revision=1506474

Comment 10 errata-xmlrpc 2015-07-22 05:52:46 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-2015-1249.html


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