Bug 714358 - SELinux is preventing /usr/sbin/httpd from 'write' accesses on the file /var/www/html/wordpress/wp-content/plugins/akismet/akismet.php.
Summary: SELinux is preventing /usr/sbin/httpd from 'write' accesses on the file /var/...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: i386
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:bee9fa2039f...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-18 12:31 UTC by mai thanh an
Modified: 2012-02-10 08:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-10 08:48:55 UTC
Type: ---


Attachments (Terms of Use)

Description mai thanh an 2011-06-18 12:31:48 UTC
SELinux is preventing /usr/sbin/httpd from 'write' accesses on the file /var/www/html/wordpress/wp-content/plugins/akismet/akismet.php.

*****  Plugin httpd_write_content (92.2 confidence) suggests  ****************

If you want to allow httpd to have write access on the akismet.php file
Then you need to change the label on '/var/www/html/wordpress/wp-content/plugins/akismet/akismet.php'
Do
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/wordpress/wp-content/plugins/akismet/akismet.php'
# restorecon -v '/var/www/html/wordpress/wp-content/plugins/akismet/akismet.php'

*****  Plugin catchall_boolean (7.83 confidence) suggests  *******************

If you want to unify HTTPD handling of all content files.
Then you must tell SELinux about this by enabling the 'httpd_unified' boolean.
Do
setsebool -P httpd_unified 1

*****  Plugin catchall (1.41 confidence) suggests  ***************************

If you believe that httpd should be allowed write access on the akismet.php file 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                unconfined_u:object_r:httpd_sys_content_t:s0
Target Objects                /var/www/html/wordpress/wp-
                              content/plugins/akismet/akismet.php [ file ]
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-26.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.7-30.fc15.i686 #1 SMP Fri May 27
                              06:02:17 UTC 2011 i686 i686
Alert Count                   1
First Seen                    Fri 17 Jun 2011 07:04:22 PM ICT
Last Seen                     Fri 17 Jun 2011 07:04:22 PM ICT
Local ID                      828aba71-c021-4515-a3b4-4d1f1d23711a

Raw Audit Messages
type=AVC msg=audit(1308312262.40:226): avc:  denied  { write } for  pid=1321 comm="httpd" name="akismet.php" dev=sda1 ino=529236 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=file


type=SYSCALL msg=audit(1308312262.40:226): arch=i386 syscall=access success=no exit=EACCES a0=21f2e790 a1=2 a2=1c298e9c a3=221a0b00 items=0 ppid=1264 pid=1321 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,httpd_sys_content_t,file,write

audit2allow

#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_unified'

allow httpd_t httpd_sys_content_t:file write;

audit2allow -R

#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_unified'

allow httpd_t httpd_sys_content_t:file write;

Comment 1 Miroslav Grepl 2011-06-20 07:23:42 UTC
Execute

# chcon -R -t httpd_sys_rw_content_t /var/www/html/wordpress/wp-content/plugins

Comment 2 Miroslav Grepl 2011-06-29 13:11:40 UTC
Fixed in selinux-policy-3.9.16-31.fc15


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