BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001125 [BusyBox] Networking Support crash always 12-21-06 19:58 01-03-07 13:56
Reporter rockeychu View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version svn
Summary 0001125: "ftpget" and "ftpput" can't access FTP server, and can't fetch ftp files with PASV mode (with patch)
Description "ftpget" & "ftpput" can't access FTP server, and can't fetch ftp files with PASV mode. This happened since Revision 16684, the same problem as previous "wget" when introduced saner bb_strtoXX.

patch as following:

Index: networking/ftpgetput.c
===================================================================
--- networking/ftpgetput.c (revision 17039)
+++ networking/ftpgetput.c (working copy)
@@ -49,6 +49,8 @@
                        *buf_ptr = '\0';
                }
        } while (!isdigit(buf[0]) || buf[3] != ' ');
+
+ buf[3] = '\0';

        return xatou(buf);
 }
@@ -58,6 +60,9 @@
        char *buf_ptr;
        unsigned short port_num;

+ buf_ptr = strrchr(buf, ')');
+ if (buf_ptr) *buf_ptr = '\0';
+
        buf_ptr = strrchr(buf, ',');
        *buf_ptr = '\0';
        port_num = xatoul_range(buf_ptr + 1, 0, 255);
@@ -123,7 +128,7 @@
        if (ftpcmd("PASV", NULL, control_stream, buf) != 227) {
                bb_error_msg_and_die("PASV error: %s", buf + 4);
        }
- fd_data = xconnect_ftpdata(server, buf);
+ fd_data = xconnect_ftpdata(server, buf + 4);

        if (ftpcmd("SIZE ", server_path, control_stream, buf) == 213) {
                //filesize = BB_STRTOOFF(buf + 4, NULL, 10);
@@ -211,7 +216,7 @@
        if (ftpcmd("PASV", NULL, control_stream, buf) != 227) {
                bb_error_msg_and_die("PASV error: %s", buf + 4);
        }
- fd_data = xconnect_ftpdata(server, buf);
+ fd_data = xconnect_ftpdata(server, buf + 4);

        /* get the local file */
        fd_local = STDIN_FILENO;
Additional Information
Attached Files

- Relationships

- Notes
(0001952)
vda
01-03-07 13:56

Fixed in rev 17146, thanks!
 

- Issue History
Date Modified Username Field Change
12-21-06 19:58 rockeychu New Issue
12-21-06 19:58 rockeychu Status new => assigned
12-21-06 19:58 rockeychu Assigned To  => BusyBox
01-03-07 13:56 vda Status assigned => closed
01-03-07 13:56 vda Note Added: 0001952
01-03-07 13:56 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker