Bug 725704

Summary: SELinux is preventing /usr/sbin/httpd from 'create' accesses on the directory files.
Product: [Fedora] Fedora Reporter: pmodin
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:164c0be8b56631f30845b8daad5c370bfb29465bf1940e0eede7ce3c02948a17
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-21 16:52:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description pmodin 2011-07-26 10:45:27 UTC
SELinux is preventing /usr/sbin/httpd from 'create' accesses on the directory files.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that httpd should be allowed create access on the files directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep httpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:user_home_t:s0
Target Objects                files [ dir ]
Source                        httpd
Source Path                   /usr/sbin/httpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           httpd-2.2.17-10.fc15.1
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-34.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.8-35.fc15.x86_64 #1 SMP Wed
                              Jul 6 13:58:54 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Tue 26 Jul 2011 12:43:46 CEST
Last Seen                     Tue 26 Jul 2011 12:43:46 CEST
Local ID                      4863b9fa-7ceb-4c31-89b8-ad26aba1b521

Raw Audit Messages
type=AVC msg=audit(1311677026.22:94): avc:  denied  { create } for  pid=3242 comm="httpd" name="files" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=dir


type=SYSCALL msg=audit(1311677026.22:94): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=7fe100bbca88 a1=1ff a2=8 a3=0 items=0 ppid=3237 pid=3242 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm=httpd exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: httpd,httpd_t,user_home_t,dir,create

audit2allow

#============= httpd_t ==============
allow httpd_t user_home_t:dir create;

audit2allow -R

#============= httpd_t ==============
allow httpd_t user_home_t:dir create;

Comment 1 Daniel Walsh 2011-07-26 13:43:39 UTC
What directory is apache creating content in?  You need to label the directory structure httpd_user_content_t.  Like ~/public_html.

If it is in public_html, then you need to run restorecon on the directory.