#27809 [Opn->Csd]: ftp_systype returns null

From: Date: Wed, 31 Mar 2004 20:34:35 +0000
Subject: #27809 [Opn->Csd]: ftp_systype returns null
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-57271@lists.php.net to get a copy of this message
ID: 27809 Updated by: iliaa@php.net Reported By: jesse dot binam at simplot dot com -Status: Open +Status: Closed Bug Type: FTP related Operating System: Any PHP Version: 4.3.5 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2004-03-31 15:15:18] 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 14:28:48] iliaa@php.net Please try the following patch and see if it resolves the problem. 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 14:21:35] 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:06:34] iliaa@php.net 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 13:44:05] jesse dot binam at simplot dot com Description: ------------ When using ftp_systype() while connected to a AS/400 (V5R2M0 in my case) returns null. Reproduce code: --------------- <?php $fc = ftp_connect('as400server'); $login = ftp_login($fc,'username','password'); $systype = ftp_systype($fc); echo $systype; ?> Expected result: ---------------- I expect the output to be 'OS/400' Actual result: -------------- a null value ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27809&edit=1

« previous php.bugs (#57271) next »