misc/73411: [patch] FTPD could set attributes to 0600 while uploading; after upload is complete it could set attributes to 0644

Michael Szklarski dysoft at kco.com.pl
Tue Nov 2 03:10:28 PST 2004


>Number:         73411
>Category:       misc
>Synopsis:       [patch] FTPD could set attributes to 0600 while uploading; after upload is complete it could set attributes to 0644
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 02 11:10:27 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michael Szklarski
>Release:        FreeBSD 5.3 BETA 7
>Organization:
FILBICO
>Environment:
>Description:
While uploading large files, it is possible to RETR an incomplete file.
FTPD opens files for writing with 0644 attributes using fopen (look into ftpd.c:store function); it is easy to change its behaviour to open these files in 0600 mode using open() and after upload is done (or broken) to fchmod the file into 0644.
>How-To-Repeat:
Run ftpd, then upload a large file (abt 100MB should do on 10MBIT LAN)
and simultaneously try to get it.
>Fix:
I have modified a little ftpd.c file (functions store(), guniquefd(), receive_data() ); please e-mail me at dysoft at kco.com.pl if anyone is interested.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list