php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27328 ftp_get don't work on a 64 bits php release
Submitted: 2004-02-20 03:12 UTC Modified: 2004-02-20 16:02 UTC
From: rouet at in2p3 dot fr Assigned:
Status: Closed Package: FTP related
PHP Version: 4CVS, 5CVS (2004-02-20) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rouet at in2p3 dot fr
New email:
PHP Version: OS:

 

 [2004-02-20 03:12 UTC] rouet at in2p3 dot fr
Description:
------------
we have to use a 64 bits compiled version of php 4.3.4 
to solve a limitation problem with popen.
an i discover that ftp_get function don't work.
i looked at the file ftp.c in ext/ftp and the problem is 
the length of a long (8 bytes) in 64 bits mode.
that's the portion of code i modified to solve ftp 
problem :
/* IP and port conversion box */
union ipbox {
        unsigned int    l[2];
/*        unsigned long    l[2];*/
        unsigned short  s[4];
        unsigned char   c[8];
};
i recompile php and now ftp-get work.

Reproduce code:
---------------
<body>
<?php
error_reporting(E_ALL);
ini_set("display_error",1);
$ftpc=ftp_connect($host);
$ftpl=ftp_login($ftpc,$user,$password);
ftp_pasv($ftpc,FALSE);
ftp_get($ftpc,$distfile,$localfile,FTP_BINARY);
ftp_pasv($ftpc,TRUE);
ftp_get($ftpc,$distfile,$localfile,FTP_BINARY);
?>

Expected result:
----------------
with passive mode off the error is
PORT required to be upper to 1024
with passive mode on the error is a timeout


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-20 04:23 UTC] rouet at in2p3 dot fr
in this release, the bug is present.
http://snaps.php.net/php4-STABLE-latest.tar.gz
JR
 [2004-02-20 16:02 UTC] pollita@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 04:01:31 2024 UTC