Bug 989868 - SELinux is preventing /usr/sbin/vsftpd from 'read' accesses on the directory /var/www/html.
SELinux is preventing /usr/sbin/vsftpd from 'read' accesses on the directory ...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-30 01:56 EDT by Marcus Summers
Modified: 2013-07-30 05:12 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-30 04:45:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marcus Summers 2013-07-30 01:56:38 EDT
Description of problem:
Updating wordpress via ftp page.
SELinux is preventing /usr/sbin/vsftpd from 'read' accesses on the directory /var/www/html.

*****  Plugin public_content (47.5 confidence) suggests  *********************

If you want to treat html as public content
Then you need to change the label on html to public_content_t or public_content_rw_t.
# semanage fcontext -a -t public_content_t '/var/www/html'
# restorecon -v '/var/www/html'

*****  Plugin catchall_boolean (47.5 confidence) suggests  *******************

If you want to determine whether ftpd can login to local users and can read and write all files on the system, governed by DAC.
Then you must tell SELinux about this by enabling the 'ftpd_full_access' boolean.
You can read 'httpd_selinux' man page for more details.
setsebool -P ftpd_full_access 1

*****  Plugin catchall (6.38 confidence) suggests  ***************************

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

Additional Information:
Source Context                system_u:system_r:ftpd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:httpd_sys_content_t:s0
Target Objects                /var/www/html [ dir ]
Source                        vsftpd
Source Path                   /usr/sbin/vsftpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           vsftpd-3.0.2-3.fc19.x86_64
Target RPM Packages           httpd-2.4.4-6.fc19.x86_64 php-
Policy RPM                    selinux-policy-3.12.1-66.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.10.3-300.fc19.x86_64 #1 SMP Fri
                              Jul 26 00:00:58 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-07-30 00:54:23 EDT
Last Seen                     2013-07-30 00:54:32 EDT
Local ID                      2f74f625-3446-4f8d-96f1-aeab1ac3b8d6

Raw Audit Messages
type=AVC msg=audit(1375160072.560:18769): avc:  denied  { read } for  pid=7589 comm="vsftpd" name="html" dev="dm-1" ino=269292 scontext=system_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir

type=SYSCALL msg=audit(1375160072.560:18769): arch=x86_64 syscall=openat success=yes exit=EINTR a0=ffffffffffffff9c a1=7f77eb3f1de0 a2=90800 a3=0 items=0 ppid=7584 pid=7589 auid=4294967295 uid=1001 gid=1004 euid=1001 suid=1001 fsuid=1001 egid=1004 sgid=1004 fsgid=1004 ses=4294967295 tty=(none) comm=vsftpd exe=/usr/sbin/vsftpd subj=system_u:system_r:ftpd_t:s0-s0:c0.c1023 key=(null)

Hash: vsftpd,ftpd_t,httpd_sys_content_t,dir,read

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.10.3-300.fc19.x86_64
type:           libreport
Comment 1 Miroslav Grepl 2013-07-30 04:45:54 EDT
The alert tells you what you can do to make this working.

You can run

# setsebool ftpd_full_access on

update wordpress via ftp page and

# setsebool ftpd_full_access off
Comment 2 Marcus Summers 2013-07-30 04:54:45 EDT
Well, if that's the case, why I am I continuously having to do it?
Comment 3 Miroslav Grepl 2013-07-30 05:12:08 EDT
You can run

# setsebool -P ftpd_full_access 1

for the permanent change

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