Bug 505590 - setroubleshoot: SELinux is preventing httpd (httpd_t) "read" to /var/www/html/index.html (user_home_t).
setroubleshoot: SELinux is preventing httpd (httpd_t) "read" to /var/www...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
11
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
setroubleshoot_trace_hash:86ad73addc1...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-12 10:34 EDT by Thomas Liu
Modified: 2009-06-12 13:50 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-12 13:50:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thomas Liu 2009-06-12 10:34:49 EDT
The following was filed automatically by setroubleshoot:

Summary:

SELinux is preventing httpd (httpd_t) "read" to /var/www/html/index.html
(user_home_t).

Detailed Description:

SELinux denied access requested by httpd. /var/www/html/index.html may be a
mislabeled. /var/www/html/index.html default SELinux type is httpd_sys_content_t,
but its current type is user_home_t. Changing this file back to the default
type, may fix your problem.

File contexts can be assigned to a file in the following ways.

  * Files created in a directory receive the file context of the parent
    directory by default.
  * The SELinux policy might override the default label inherited from the
    parent directory by specifying a process running in context A which creates
    a file in a directory labeled B will instead create the file with label C.
    An example of this would be the dhcp client running with the dhclient_t type
    and creates a file in the directory /etc. This file would normally receive
    the etc_t type due to parental inheritance but instead the file is labeled
    with the net_conf_t type because the SELinux policy specifies this.
  * Users can change the file context on a file using tools such as chcon, or
    restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package.

Allowing Access:

You can restore the default system context to this file by executing the
restorecon command. restorecon '/var/www/html/index.html', if this file is a
directory, you can recursively restore using restorecon -R
'/var/www/html/index.html'.

Fix Command:

/sbin/restorecon '/var/www/html/index.html'

Additional Information:

Source Context                unconfined_u:system_r:httpd_t:s0
Target Context                system_u:object_r:user_home_t:s0
Target Objects                /var/www/html/index.html [ file ]
Source                        httpd
Source Path                   /usr/sbin/httpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           httpd-2.2.11-8
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-47.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     (removed)
Platform                      Linux Ares 2.6.29.4-167.fc11.i586 #1 SMP Wed May
                              27 17:14:37 EDT 2009 i686 i686
Alert Count                   4
First Seen                    Thu 11 Jun 2009 03:34:10 PM EDT
Last Seen                     Fri 12 Jun 2009 10:12:32 AM EDT
Local ID                      23ab45e8-d48f-4ca6-ba6c-fa588d78822f
Line Numbers                  

Raw Audit Messages            

node=Ares type=AVC msg=audit(1244815952.160:44): avc:  denied  { read } for  pid=2893 comm="httpd" name="index.html" dev=dm-0 ino=539 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file

node=Ares type=SYSCALL msg=audit(1244815952.160:44): arch=40000003 syscall=5 success=no exit=-13 a0=21838a8 a1=8000 a2=0 a3=1021 items=0 ppid=2887 pid=2893 auid=500 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)


audit2allow suggests:

#============= httpd_t ==============
allow httpd_t user_home_t:file read;
Comment 1 Daniel Walsh 2009-06-12 13:50:21 EDT
Read the Troubleshoot....  :^)
Click the Fix It.

Stop bothering me..

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