Bug 1388805 - SELinux is preventing httpd from 'getattr' accesses on the file /var/www/html/gcf/html5/ph5p2ed/L0308/gravel.jpg.
Summary: SELinux is preventing httpd from 'getattr' accesses on the file /var/www/html...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 24
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:d0c5696500b50514fc0df463f1a...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-26 08:31 UTC by Nivag
Modified: 2016-11-02 13:33 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-02 13:33:34 UTC
Type: ---


Attachments (Terms of Use)

Description Nivag 2016-10-26 08:31:18 UTC
Description of problem:
Using firefox to display an html page on loclahostthat refered to a jpg file in the same directory
SELinux is preventing httpd from 'getattr' accesses on the file /var/www/html/gcf/html5/ph5p2ed/L0308/gravel.jpg.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to allow httpd to read user content
Then you must tell SELinux about this by enabling the 'httpd_read_user_content' boolean.
You can read 'None' man page for more details.
Do
setsebool -P httpd_read_user_content 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If you believe that httpd should be allowed getattr access on the gravel.jpg 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:
# ausearch -c 'httpd' --raw | audit2allow -M my-httpd
# semodule -X 300 -i my-httpd.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                unconfined_u:object_r:home_bin_t:s0
Target Objects                /var/www/html/gcf/html5/ph5p2ed/L0308/gravel.jpg [
                              file ]
Source                        httpd
Source Path                   httpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    <Unknown>
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.7.9-200.fc24.x86_64 #1 SMP Thu
                              Oct 20 14:26:16 UTC 2016 x86_64 x86_64
Alert Count                   45
First Seen                    2016-10-26 18:34:08 NZDT
Last Seen                     2016-10-26 20:56:04 NZDT
Local ID                      089cb97b-936b-421b-9aa9-b4dfdb3f8da6

Raw Audit Messages
type=AVC msg=audit(1477468564.821:4311): avc:  denied  { getattr } for  pid=31838 comm="httpd" path="/var/www/html/gcf/html5/ph5p2ed/L0308/gravel.jpg" dev="dm-0" ino=527480 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:home_bin_t:s0 tclass=file permissive=0


Hash: httpd,httpd_t,home_bin_t,file,getattr


Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.9-200.fc24.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2016-11-02 13:33:34 UTC
Please run:
# restorecon -Rv /var/www/html/

To fix your issue.


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