PHP :: Bug #27809 :: ftp_systype returns null |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27809 ftp_systype returns null
Submitted: 2004-03-31 13:44 UTC Modified: 2004-03-31 15:34 UTC
From: jesse dot binam at simplot dot com Assigned:
Status: Closed Package: FTP related
PHP Version: 4.3.5 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
15 + 2 = ?
Subscribe to this entry?

 [2004-03-31 13:44 UTC] jesse dot binam at simplot dot com
When using ftp_systype() while connected to a AS/400 (V5R2M0 in my case) returns null.

Reproduce code:

$fc = ftp_connect('as400server');
$login = ftp_login($fc,'username','password');
$systype = ftp_systype($fc);
echo $systype;


Expected result:
I expect the output to be

Actual result:
a null value


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-31 14:06 UTC]
What does SYST command return on your FTP server? The php's 
ftp_systype() is pretty much a wrapper around execution of 
SYST and fetching the response. 
 [2004-03-31 14:21 UTC] jesse dot binam at simplot dot com
ftp> quote SYST
215  OS/400 is the remote operating system. The TCP/IP version is "V5R2M0".
 [2004-03-31 14:28 UTC]
Please try the following patch and see if it resolves the 
Index: ftp.c 
RCS file: /repository/php-src/ext/ftp/ftp.c,v 
retrieving revision 1.102 
diff -u -3 -p -r1.102 ftp.c 
--- ftp.c       18 Mar 2004 17:12:07 -0000      1.102 
+++ ftp.c       31 Mar 2004 19:37:38 -0000 
@@ -394,6 +394,9 @@ ftp_syst(ftpbuf_t *ftp) 
                return NULL; 
        syst = ftp->inbuf; 
+       while (*syst == ' ') { 
+               syst++; 
+       } 
        if ((end = strchr(syst, ' '))) { 
                *end = 0; 
 [2004-03-31 15:15 UTC] jesse dot binam at simplot dot com
Sweet! That fixed it. Sorry it took so long, I at some point must have done a make clean and my system isn't the fastest.
 [2004-03-31 15:34 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Aug 16 13:01:24 2018 UTC