[BusyBox 0001088]: "wget" can't fetch ftp files with PASV mode (with patch)

bugs at busybox.net bugs at busybox.net
Tue Nov 21 12:45:17 UTC 2006


The following issue has been REOPENED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1088 
====================================================================== 
Reported By:                rockeychu
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1088
Category:                   Networking Support
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             11-09-2006 19:13 PST
Last Modified:              11-21-2006 04:45 PST
====================================================================== 
Summary:                    "wget" can't fetch ftp files with PASV mode (with
patch)
Description: 
When fetch ftp files with PASV mode, wget always reports following error:
    wget: invalid number 'XXX).'
where XXX is port number.

The simple solution is as following (or trimming PASV's port number
endings ').' ):

Index: libbb/xatol.c
===================================================================
--- libbb/xatol.c       (revision 16525)
+++ libbb/xatol.c       (working copy)
@@ -79,8 +79,8 @@

        /* Note: trailing space is an error.
           It would be easy enough to allow though if desired. */
-       if (*e)
-               goto inval;
+       //if (*e)
+       //      goto inval;
        /* Finally, check for range limits. */
        if (r >= lower && r <= upper)
                return r;

====================================================================== 

---------------------------------------------------------------------- 
 vda - 11-21-06 03:06  
---------------------------------------------------------------------- 
Yeah, yeah, let's kill error checks for everybody, just because we are too
lazy to find the bug...

Fixed correctly in rev 16603. 

---------------------------------------------------------------------- 
 rockeychu - 11-21-06 04:45  
---------------------------------------------------------------------- 
Sorry for my lazy to adding any code of trimming PASV's port number
endings.

But rev 16603 still has same problem with "proftpd" for its ending with
").".

So, again with the folling patch:

Index: networking/wget.c
===================================================================
--- networking/wget.c   (revision 16606)
+++ networking/wget.c   (working copy)
@@ -418,7 +418,7 @@
                // Server's IP is N1.N2.N3.N4 (we ignore it)
                // Server's port for data connection is P1*256+P2
                s = strrchr(buf, ')');
-               if (s && !s[1]) s[0] = '\0';
+               if (s && (!s[1] || !s[2])) s[0] = '\0';
                s = strrchr(buf, ',');
                if (!s) goto pasv_error;
                port = xatol_range(s+1, 0, 255); 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-09-06 19:13  rockeychu      New Issue                                    
11-09-06 19:13  rockeychu      Status                   new => assigned     
11-09-06 19:13  rockeychu      Assigned To               => BusyBox         
11-21-06 03:06  vda            Status                   assigned => closed  
11-21-06 03:06  vda            Note Added: 0001749                          
11-21-06 03:06  vda            Resolution               open => fixed       
11-21-06 03:06  vda            Fixed in Version          => 1.2.x           
11-21-06 04:45  rockeychu      Status                   closed => feedback  
11-21-06 04:45  rockeychu      Resolution               fixed => reopened   
11-21-06 04:45  rockeychu      Note Added: 0001754                          
======================================================================




More information about the busybox-cvs mailing list