misc/73411: [patch] FTPD could set attributes to 0600 while
uploading; after upload is complete it could set attributes to 0644
dysoft at kco.com.pl
Tue Nov 2 03:10:28 PST 2004
>Synopsis: [patch] FTPD could set attributes to 0600 while uploading; after upload is complete it could set attributes to 0644
>Arrival-Date: Tue Nov 02 11:10:27 GMT 2004
>Originator: Michael Szklarski
>Release: FreeBSD 5.3 BETA 7
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.
Run ftpd, then upload a large file (abt 100MB should do on 10MBIT LAN)
and simultaneously try to get it.
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.
More information about the freebsd-bugs