Bug 748718

Summary: SELinux is preventing /usr/sbin/vsftpd from 'write' accesses on the directory /home/gianluca.
Product: [Fedora] Fedora Reporter: gianluca <gimaldi>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG 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:fc1a9c769243fbcd605deaa2bf8cfb8ea8aad411cd9c5190749eb25768a6d85c
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-25 07:57:58 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 gianluca 2011-10-25 07:03:04 UTC
SELinux is preventing /usr/sbin/vsftpd from 'write' accesses on the directory /home/gianluca.

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

If you want to allow ftp servers to login to local users and read/write all files on the system, governed by DAC.
Then you must tell SELinux about this by enabling the 'allow_ftpd_full_access' boolean.
Do
setsebool -P allow_ftpd_full_access 1

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

If you want to allow ftp to read and write files in the user home directories
Then you must tell SELinux about this by enabling the 'ftp_home_dir' boolean.
Do
setsebool -P ftp_home_dir 1

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

If you believe that vsftpd should be allowed write access on the gianluca 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 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                unconfined_u:object_r:user_home_dir_t:s0
Target Objects                /home/gianluca [ dir ]
Source                        vsftpd
Source Path                   /usr/sbin/vsftpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           vsftpd-2.3.4-1.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-39.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.40.6-0.fc15.x86_64 #1 SMP Tue Oct 4 00:39:50
                              UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Tue 25 Oct 2011 08:48:50 AM CEST
Last Seen                     Tue 25 Oct 2011 08:50:19 AM CEST
Local ID                      913b32d2-bc8a-491c-9264-bc29eb9d451e

Raw Audit Messages
type=AVC msg=audit(1319525419.244:136): avc:  denied  { write } for  pid=3080 comm="vsftpd" name="gianluca" dev=sda5 ino=14417921 scontext=system_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir


type=AVC msg=audit(1319525419.244:136): avc:  denied  { add_name } for  pid=3080 comm="vsftpd" name="om651_suu_a00.iso.003" scontext=system_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir


type=SYSCALL msg=audit(1319525419.244:136): arch=x86_64 syscall=open success=yes exit=EINTR a0=7f2df09fd640 a1=841 a2=1b6 a3=7fff9fdf14f0 items=0 ppid=3073 pid=3080 auid=4294967295 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=4294967295 comm=vsftpd exe=/usr/sbin/vsftpd subj=system_u:system_r:ftpd_t:s0-s0:c0.c1023 key=(null)

Hash: vsftpd,ftpd_t,user_home_dir_t,dir,write

audit2allow

#============= ftpd_t ==============
#!!!! This avc is allowed in the current policy

allow ftpd_t user_home_dir_t:dir { write add_name };

audit2allow -R

#============= ftpd_t ==============
#!!!! This avc is allowed in the current policy

allow ftpd_t user_home_dir_t:dir { write add_name };

Comment 1 Miroslav Grepl 2011-10-25 07:57:58 UTC
If you want to allow to share your home then you need to turn on the ftp_home_dir boolean.

# setsebool -P ftp_home_dir 1