PHP :: Bug #22402 :: fopen with ftp url
| Bug #22402 | fopen with ftp url | ||||
|---|---|---|---|---|---|
| Submitted: | 2003-02-24 14:43 UTC | Modified: | 2003-02-24 22:21 UTC | ||
| From: | jan+php at jancm dot org | Assigned: | iliaa (profile) | ||
| Status: | Closed | Package: | FTP related | ||
| PHP Version: | 4.3.1 | OS: | Win2K | ||
| Private report: | No | CVE-ID: | None | ||
[2003-02-24 14:43 UTC] jan+php at jancm dot org
fopen will, apparently, always open a pasv mode data connection (to a ftp type url). Most ftp servers return a code of:
150 "File status okay; about to open data connection",
but in some cases they return a
125 "125 Data connection already open; transfer starting."
(It really depends on the server. WarFTP will return a 125);
fopen works fine when a 150 is returned. It breaks when a 125 is returned instead.
I *think* the only change needed is in line 418 of
ext\standard\ftp_fopen_wrapper.c (based on 4.3.1 source), but I can't compile it to check. :(
Currently it reads:
if (result != 150) {
and I think it should be:
if (result != 150 && result != 125) {
References:
RFC 959
also see ext\ftp\ftp.c
lines: 683, 765, 1473, 1581, and 1694
(the ftp functions all work fine in both passive and active modes).
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-02-24 22:21 UTC] iliaa@php.net