This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: ftplib passive ftp problem on multihomed clients
类型: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
状态: open Resolution:
Dependencies: 后续: Add a "source_address" option to ftplib
View: 8594
分配给: giampaolo.rodola 抄送列表: exarkun, giampaolo.rodola, pitrou, timbaum
优先级: normal 关键字: patch

timbaum2007-02-16 19:36 创建。最近一次由 admin2022-04-11 14:56 修改。

文件
文件名 上传时间 Description 编辑
ftplib.patch timbaum, 2007-02-16 19:36 patch in unified forward diff format
ftplib.patch giampaolo.rodola, 2011-03-03 22:12 review
Messages (4)
msg51894 - (view) Author: Tim Baum (timbaum) 日期: 2007-02-16 19:36
When using passive FTP on a multihomed client, data connections should originate from the same address as the control connection.  Otherwise, the connection can be blocked by stateful firewalls or rejected by the ftp server.  The ftplib.py library allows the OS to choose the local address for each passive data connection, so connections fail intermittently if the operating system selects a different local address than used for the initial connection.

The attached patch binds the passive-mode data connection to the same local address as the control connection.
msg104750 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) 日期: 2010-05-01 20:39
Issue 8594 is related with this one.
msg130007 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) 日期: 2011-03-03 22:12
Patch in attachment updates the previous one which no longer applies cleanly in py 3.3.
The control connection address is used for *both* passive (PASV) and active (PORT) connections, which is the same approach I used in pyftpdlib.

Removed test_source_address_passive_connection test because we do not want that the same (host, port) is used for both control and data connections.

I think it makes sense to port this patch in previous python versions as well.
msg130009 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) 日期: 2011-03-03 22:24
> we do not want that the same (host, port) is used for
> both control and data connections.

I meant *port*, not (host, port).
历史
日期 用户 动作 参数
2022-04-11 14:56:22admin修改github: 44590
2011-03-03 22:24:05giampaolo.rodola修改抄送: exarkun, pitrou, giampaolo.rodola, timbaum
消息: + msg130009
2011-03-03 22:13:20giampaolo.rodola修改assignee: giampaolo.rodola
抄送: exarkun, pitrou, giampaolo.rodola, timbaum
2011-03-03 22:12:34giampaolo.rodola修改文件: + ftplib.patch
versions: + Python 3.3
抄送: + exarkun, pitrou

消息: + msg130007

stage: test needed -> patch review
2010-09-16 21:04:04BreamoreBoy修改versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6, Python 3.0
2010-05-01 20:39:48giampaolo.rodola修改后续: Add a "source_address" option to ftplib
消息: + msg104750
2009-03-30 21:41:08ajaksu2修改抄送: + giampaolo.rodola
versions: + Python 2.6, Python 3.0, - Python 2.5

type: behavior
stage: test needed
2007-02-16 19:36:59timbaum创建