Bug 164951

Summary: Anonymous ftp r/w acces doesn't work
Product: [Fedora] Fedora Reporter: Gabriel Schulhof <gabrielschulhof>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-09 11:15:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gabriel Schulhof 2005-08-03 00:54:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.10) Gecko/20050719 Fedora/1.7.10-1.5.1

Description of problem:
I was told that the proper way to get anonymous ftp uploading /and/ downloading to work is to chcon -t ftpd_anon_rw_t those directories off /var/ftp where I want to allow users to upload.

I now have
# ls -lZ /var/ftp
drwxr-xr-x  root     root     system_u:object_r:ftpd_anon_t    FC3-PPC
drwxrwxrwt  root     root     system_u:object_r:ftpd_anon_rw_t incoming
drwxr-xr-x  root     root     system_u:object_r:ftpd_anon_t    RH8.0

and yet, when I log in anonymously via ftp and type ls -l, I get
drwxr-xr-x    7 0        0            4096 Jul 17 22:16 FC3-PPC
drwxr-xr-x    7 0        0            4096 Jul 17 21:46 RH8.0

and

type=AVC msg=audit(1123030303.030:11822060): avc:  denied  { getattr } for  pid=309 comm="vsftpd" name="incoming" dev=hda1 ino=2256658 scontext=system_u:system_r:ftpd_t tcontext=system_u:object_r:ftpd_anon_rw_t tclass=dir
type=SYSCALL msg=audit(1123030303.030:11822060): arch=40000003 syscall=196 success=no exit=-13 a0=866b828 a1=866b838 a2=df4ff4 a3=41ceec items=1 pid=309 auid=4294967295 uid=14 gid=50 euid=14 suid=14 fsuid=14 egid=50 sgid=50 fsgid=50 comm="vsftpd" exe="/usr/sbin/vsftpd"
type=AVC_PATH msg=audit(1123030303.030:11822060):  path="/incoming"
type=CWD msg=audit(1123030303.030:11822060):  cwd="/"
type=PATH msg=audit(1123030303.030:11822060): item=0 name="incoming" flags=0  inode=2256658 dev=03:01 mode=041777 ouid=0 ogid=0 rdev=00:00

in /var/log/audit/audit.log .

So, how do I get anonymous ftp r/w to work ?

Version-Release number of selected component (if applicable):
selinux-policy-targeted-1.25.3-6

How reproducible:
Always

Steps to Reproduce:
1. Install FC4 with vsftpd
2. Create /var/ftp/incoming and chcon it to ftpd_anon_rw_t
3. Attempt to access /incoming anonymously over ftp
  

Actual Results:  I couldn't change directories, and I got the above-mentioned audit messages.

Expected Results:  I should have been able to access the directory just fine.


Additional info:

This might have b0rken starting with selinux-policy-targeted-1.25.3-6 .

Comment 1 Gabriel Schulhof 2005-08-09 08:59:22 UTC
With selinux-policy-targeted-1.25.3-9, I still need

allow ftpd_t ftpd_anon_rw_t:dir { search read getattr write add_name };
allow ftpd_t ftpd_anon_rw_t:file { getattr create append } ;

to make anonymous r/w work.

Comment 2 Gabriel Schulhof 2005-08-09 09:11:59 UTC
Sorry. Make that second line

allow ftpd_t ftpd_anon_rw_t:file { getattr create append read } ;

Comment 3 Daniel Walsh 2005-08-09 11:15:53 UTC
You don't need those.  You can turn it on with the allow_ftpd_anon_write boolean.

setsebool -P allow_ftpd_anon_write=1