Bug 13261 - ftpd mishandles STAT command during a file transfer
Summary: ftpd mishandles STAT command during a file transfer
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-08-19 23:30 UTC by ian
Modified: 1999-09-12 02:28 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 ian 1999-08-19 23:30:00 UTC
When a STAT command is sent to ftpd as an out-of-band transmission during a file transfer, the command is mishandled on every other receipt of the command.  On the first receipt, the command is handled correctly, but is left in the tmpline buffer.  On the next SIGURG, the hacked-up getline() returns an empty string and that STAT request is ignored.  The next one works, the one after that fails, and so on.

Fix: 

In ftpd.c, in the myoob() routine, a line should be added in the if branch that handles the STAT command, to set tmpline[0] = '\0'; (as it already does for the ABOR command).  I have applied and tested this fix on my local system, and it results in correct behavior (every STAT request receives a response).
How-To-Repeat: Send a series of STAT requests as OOB data to an ftpd while a file transfer is in progress, and observe that you get a response to every other request.
Comment 1 Michael Haro freebsd_committer freebsd_triage 1999-09-12 02:27:55 UTC
State Changed
From-To: open->closed

Fix committed.  Thanks for finding this.