Bug 787511 - SELinux is preventing /usr/sbin/httpd from 'append' accesses on the file baza.txt.
Summary: SELinux is preventing /usr/sbin/httpd from 'append' accesses on the file baza...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 16
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:0c43e5cc44b71777fcfcc36d2ef...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-05 21:10 UTC by ziomalon
Modified: 2012-02-06 08:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-06 08:07:29 UTC
Type: ---


Attachments (Terms of Use)

Description ziomalon 2012-02-05 21:10:22 UTC
libreport version: 2.0.6
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.1.0-7.fc16.i686
reason:         SELinux is preventing /usr/sbin/httpd from 'append' accesses on the file baza.txt.
time:           Sun Feb  5 22:09:33 2012

description:
:SELinux is preventing /usr/sbin/httpd from 'append' accesses on the file baza.txt.
:
:*****  Plugin httpd_write_content (92.2 confidence) suggests  ****************
:
:If you want to allow httpd to have append access on the baza.txt file
:Then you need to change the label on 'baza.txt'
:Do
:# semanage fcontext -a -t httpd_sys_rw_content_t 'baza.txt'
:# restorecon -v 'baza.txt'
:
:*****  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 append access on the baza.txt 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                baza.txt [ file ]
:Source                        httpd
:Source Path                   /usr/sbin/httpd
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           httpd-2.2.21-1.fc16
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-46.fc16
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.1.0-7.fc16.i686 #1 SMP Tue Nov 1
:                              21:00:16 UTC 2011 i686 i686
:Alert Count                   4
:First Seen                    Sun 05 Feb 2012 09:56:44 PM CET
:Last Seen                     Sun 05 Feb 2012 10:01:15 PM CET
:Local ID                      1bbf9b09-9537-4628-8a7b-77029f577f7b
:
:Raw Audit Messages
:type=AVC msg=audit(1328475675.0:1354): avc:  denied  { append } for  pid=16353 comm="httpd" name="baza.txt" dev=dm-1 ino=131109 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1328475675.0:1354): arch=i386 syscall=open success=no exit=EACCES a0=2129ff8c a1=441 a2=1b6 a3=2129ff8c items=0 ppid=2895 pid=16353 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,append
:
:audit2allow
:
:#============= httpd_t ==============
:#!!!! This avc can be allowed using the boolean 'httpd_unified'
:
:allow httpd_t httpd_sys_content_t:file append;
:
:audit2allow -R
:
:#============= httpd_t ==============
:#!!!! This avc can be allowed using the boolean 'httpd_unified'
:
:allow httpd_t httpd_sys_content_t:file append;
:

Comment 1 Miroslav Grepl 2012-02-06 08:07:29 UTC
What is baza.txt? 

You will need to add a proper label for it. sealert tells you what to do. You can try to use chcon to make sure that your changes will work

# chcon -t httpd_sys_rw_content_t PATHO/baza.txt


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