You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Start an ftp server as in quick start at
https://code.google.com/p/pyftpdlib/ .
2. Look at the file handles opened by Python (in Linux, find out the
process id and ls -l /proc/processid/fd).
3. Connect to the server using an ftp client that opens an active data
connection before STOR (at least Linux's plain "ftp" does this).
4. Try to put a file, getting a 550 error. Quit.
5. Look at the file handles again. Notice that some sockets were not closed.
Repeat steps 3-5 to increase used socket handles as much as you want.
Eventually this will hit the system file handle limit, causing the ftp
server to become inoperative.
The bug will not occur if the ftp client closes the connection abruptly,
e.g. if you kill -9 the ftp client process.
Example snippet for steps 3-4 from an ftp client:
ftp> put 123
local: 123 remote: 123
200 Active data connection established.
550 Can't STOR. Not enough privileges.
ftp> quit
221 Goodbye.
What is the expected output?
What do you see instead?
See above.
What version of pyftpdlib are you using? On what operating system? Which
Python version?
Pyftpdlib 0.4.0, on Ubuntu hardy, with Python 2.5.2.
Please provide any additional information below.
Adding the following to ftpserver.py's ftp_QUIT fixes this:
+ if not self.data_channel.transfer_in_progress():
+ self.data_channel.close()
+ self.data_channel = None
if not self.data_channel:
self.close_when_done()
else:
# tell the cmd channel to stop responding to commands.
self.quit_pending = True
Summary: Socket handles are leaked when a data transfer is in progress and user QUITs Status: Finished Labels: Version-0.4.0 Milestone-0.4.1 OpSys-Linux Security
From Rauli.Ru...@gmail.com on June 26, 2008 17:03:39
Original issue: http://code.google.com/p/pyftpdlib/issues/detail?id=71
The text was updated successfully, but these errors were encountered: