Bug 73411 - [request] ftpd(8) could set attributes to 0600 while uploading; after upload is complete it could set attributes to 0644
Summary: [request] ftpd(8) could set attributes to 0600 while uploading; after upload ...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-02 11:10 UTC by Michael Szklarski
Modified: 2018-05-20 23:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Szklarski 2004-11-02 11:10:27 UTC
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.

Fix: 

I have modified a little ftpd.c file (functions store(), guniquefd(),
receive_data() ); please e-mail me at dysoft@kco.com.pl if anyone is interested.
How-To-Repeat: Run ftpd, then upload a large file (abt 100MB should do on 10MBIT LAN)
and simultaneously try to get it.
Comment 1 kamikaze 2008-02-22 20:57:42 UTC
Kinda makes sense to me, not to let people download incomplete files.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2008-02-23 03:08:28 UTC
State Changed
From-To: open->feedback

To submitter: do you still have the patch available?
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2008-04-11 20:31:45 UTC
State Changed
From-To: feedback->suspended

Submitter is no longer using FreeBSD and no longer has the patches 
available.  Mark this as suspended in case someone wants to pick up 
this idea.
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:57:15 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"