Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftplib: Strict RFC 959 (telnet in command channel) #39394

Closed
phdru mannequin opened this issue Oct 11, 2003 · 5 comments
Closed

ftplib: Strict RFC 959 (telnet in command channel) #39394

phdru mannequin opened this issue Oct 11, 2003 · 5 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@phdru
Copy link
Mannequin

phdru mannequin commented Oct 11, 2003

BPO 821862
Nosy @phdru, @ods, @giampaolo
Files
  • ftplib.py.patch: The patch for ftplib.py to implement telnet option
  • ftplib.py.patch2: This is another solution to the same problem. Instead of patching FTP class the patch creates TelnetFTP subclass.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2003-10-11.18:04:55.000>
    labels = ['type-bug', 'library']
    title = 'ftplib: Strict RFC 959 (telnet in command channel)'
    updated_at = <Date 2013-05-26.00:59:29.963>
    user = 'https://github.com/phdru'

    bugs.python.org fields:

    activity = <Date 2013-05-26.00:59:29.963>
    actor = 'BreamoreBoy'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2003-10-11.18:04:55.000>
    creator = 'phd'
    dependencies = []
    files = ['5624', '5625']
    hgrepos = []
    issue_num = 821862
    keywords = ['patch']
    message_count = 4.0
    messages = ['44756', '84537', '114127', '114133']
    nosy_count = 3.0
    nosy_names = ['phd', 'ods', 'giampaolo.rodola']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'test needed'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue821862'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4']

    @phdru
    Copy link
    Mannequin Author

    phdru mannequin commented Oct 11, 2003

    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.

    @phdru phdru mannequin added stdlib Python modules in the Lib dir labels Oct 11, 2003
    @phdru
    Copy link
    Mannequin Author

    phdru mannequin commented Mar 30, 2009

    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.

    @devdanzin devdanzin mannequin added type-bug An unexpected behavior, bug, or error labels May 12, 2009
    @giampaolo
    Copy link
    Contributor

    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.

    @phdru
    Copy link
    Mannequin Author

    phdru mannequin commented Aug 17, 2010

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    @zitterbewegung
    Copy link
    Contributor

    zitterbewegung commented Apr 25, 2023

    This issue has patches from 2004 which don't apply cleanly, they require telnetlib which will be deprecated in Python 3.13 and there is a lack of interest for the feature so IMHO this should be closed.

    @arhadthedev arhadthedev closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants