bugGNU Wget - Bugs: bug #20359, spaces in filename can cause wget...

 
 

bug #20359: spaces in filename can cause wget to infloop

Submitted by:  Micah Cowan <micahcowan>
Submitted on:  Thu 05 Jul 2007 11:52:22 PM UTC  
 
Category: NoneSeverity: 4 - Important
Priority: 5 - NormalStatus: Invalid
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Closed
Release: NoneOperating System: Mac OS
Reproducibility: NoneFixed Release: None
Planned Release: NoneRegression: None
Work Required: NonePatch Included: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 16 Jul 2007 09:25:29 PM UTC, comment #1:

The patch is inappropriate, as it breaks the protocol.

The reporter is having trouble reproducing this problem, so it falls off the radar now.

This should be reopened if it is reproduced.

Micah Cowan <micahcowan>
Thu 05 Jul 2007 11:52:22 PM UTC, original submission:

From http://article.gmane.org/gmane.comp.web.wget.general/6725/ :

On OS X, if a filename on the FTP server contains spaces, and the
remote copy of the file is newer than the local, then wget gets
thrown into a loop of "No such file or directory" endlessly. I have
changed the following in ftp-simple.c, and this fixes the error.
Sorry, I don't know how to use the proper patch formatting, but it
should be clear.

==================================
the beginning of ftp_retr:
=================================
/* Sends RETR command to the FTP server. */
uerr_t
ftp_retr (int csock, const char *file)
{
char request, respline;
int nwritten;
uerr_t err;

/* Send RETR request. */
request = ftp_request ("RETR", file);

==================================
becomes:
==================================
/* Sends RETR command to the FTP server. */
uerr_t
ftp_retr (int csock, const char *file)
{
char request, respline;
int nwritten;
uerr_t err;
char filecopy[2048];
if (file[0] != '"') {
sprintf(filecopy, "\"%.2047s\"", file);
} else {
strncpy(filecopy, file, 2047);
}

/* Send RETR request. */
request = ftp_request ("RETR", filecopy);

[Note, as Hrvoje suggests, aprintf() would be preferable to the above, which also includes a potential buffer overflow.]

Micah Cowan <micahcowan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by micahcowan (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 16 Jul 2007 09:25:29 PM UTCmicahcowanStatusNone=>Invalid
      Open/ClosedOpen=>Closed
      Planned Release1.11=>None

    Back to the top


    Powered by Savane 3.1-cleanup1