URL: <http://savannah.gnu.org/bugs/?51284>
Summary: Wget incorrectly parses FTP listing if filenames have leading spaces Project: GNU Wget Submitted by: None Submitted on: Wed 21 Jun 2017 09:12:56 AM UTC Category: Program Logic Severity: 3 - Normal Priority: 5 - Normal Status: None Privacy: Public Assigned to: None Originator Name: Roger Lainson Originator Email: ro...@sdr.com.au Open/Closed: Open Discussion Lock: Any Release: 1.17.1 Operating System: GNU/Linux Reproducibility: Every Time Fixed Release: None Planned Release: None Regression: None Work Required: None Patch Included: No _______________________________________________________ Details: Wget incorrectly parses the FTP listing if filenames have leading spaces. Given a remote file with a name like ' X' (admittedly unusual but legal in Linux), Wget incorrectly determines the filename as 'X' from the LIST command, and hence a RETR for the file fails with '550 Failed to open file' or similar. See attached output from Wget, and corresponding .listing file. Worth noting that WinSCP has the same problem, as may other FTP clients. In fact filenames like ' X' are not easy to create (without shell access to the FTP server), so this is probably not a high priority problem. A suggestion: rather than assume there are no leading spaces in the filename (the current parsing method), maybe we could look for the directory '..' in the listing, and use that to note the character position which is the start of the filename. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Wed 21 Jun 2017 09:12:56 AM UTC Name: Wget example - filename with leading spaces.txt Size: 4kB By: None (.listing has been renamed to ..listing to satisfy Windows) <http://savannah.gnu.org/bugs/download.php?file_id=40963> ------------------------------------------------------- Date: Wed 21 Jun 2017 09:12:56 AM UTC Name: ..listing Size: 186B By: None (.listing has been renamed to ..listing to satisfy Windows) <http://savannah.gnu.org/bugs/download.php?file_id=40964> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?51284> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/