Issue 821862: ftplib: Strict RFC 959 (telnet in command channel) (original) (raw)

Created on 2003-10-11 18:04 by phd, last changed 2022-04-10 16:11 by admin.

Files
File name Uploaded Description Edit
ftplib.py.patch phd,2003-10-11 18:04 The patch for ftplib.py to implement telnet option
ftplib.py.patch2 phd,2004-10-21 09:52 This is another solution to the same problem. Instead of patching FTP class the patch creates TelnetFTP subclass.
Messages (4)
msg44756 - (view) Author: Oleg Broytman (phd) * Date: 2003-10-11 18:04
RFC 959 *requires* to implemet a portion of the telnet protocol in the command channel. Without this ftlib has problems interacting with RFC959-compliant server (most Unix ftp daemons are compliant) if, e.g., a directory or a filename contains russian characters. The attched patch implements a minimal requirement (it doubles chr(255) in the .putline() method), but it allows a programer to choose if a session will be strict or not. Default value is "not strict" because most clients (even Unix clients) do not implemet this telnet option, and most Windoze servers do not implemet it. Tested with ProFTPd on GNU/Linux system.
msg84537 - (view) Author: Oleg Broytman (phd) * Date: 2009-03-30 11:53
Since I've created the issue I found there are different servers even in Unix. ProFTPd (and, I believe wu-ftpd) strictly implement telnet-in-command channel, they even don't have an option to turn it off. PureFTPd doesn't implement it. On the client side - lftp (command line client) and squid (well-known web/ftp proxy) implement telnet-in-command channel.
msg114127 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-08-17 15:06
Other than IAC what other chars need to be doubled? As an alternative to a brand new TelnetFTP class this can be implemented as a FTP class attribute ("strict_telnet" maybe) defaulting to True.
msg114133 - (view) Author: Oleg Broytman (phd) * Date: 2010-08-17 16:20
> Other than IAC what other chars need to be doubled? Only IAC must be doubled. Also there have to be a special prefix for urgent (out-of-bound) commands (ABORt); I didn't implement that. > As an alternative to a brand new TelnetFTP class this can be implemented as a FTP class attribute ("strict_telnet" maybe) defaulting to True. See the first patch. Default value is False to preserve backward compatibility.
History
Date User Action Args
2022-04-10 16:11:41 admin set github: 39394
2013-05-26 00:59:29 BreamoreBoy set versions: + Python 2.7, Python 3.3, Python 3.4, - Python 2.6, Python 3.1
2010-08-24 22:22:15 eric.araujo link issue1576598 superseder
2010-08-24 22:19:52 BreamoreBoy unlink issue1576598 dependencies
2010-08-17 16:20:37 phd set messages: +
2010-08-17 15:06:20 giampaolo.rodola set messages: +
2009-05-12 17:04:25 ajaksu2 link issue1576598 dependencies
2009-05-12 17:03:44 ajaksu2 set stage: test neededtype: behaviorversions: + Python 2.6, Python 3.1, - Python 2.4
2009-03-30 11:53:49 phd set nosy: + odsmessages: +
2008-09-22 00:11:32 giampaolo.rodola set nosy: + giampaolo.rodola
2003-10-11 18:04:55 phd create