bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] Bug: resources can't be mirrored via FTP if their name starts


From: Christian Rosentreter
Subject: [Bug-wget] Bug: resources can't be mirrored via FTP if their name starts with a space character
Date: Mon, 8 Apr 2019 02:13:25 +0200

Hi there,

A small bug I encountered: if any file or directory on a remote machine has 
pathnames
starting with one or more spaces (e.g. " foobar.txt") then Wget fails to mirror 
those
resources via the good old FTP protocol. Tested with '1.18' and up-to-date 
'1.20.3' on
Mac OS X.

If required, I could provide a testing FTP account for this particular setup to 
a
Wget developer (privately.)


with kind regards,
Christian Rosentreter




----

Example:

wget \
        --config auth.config \
        --mirror \
        --no-host-directories \
        --append-output wget.log \
        ftp://wget.annex.binaryriot.org/ 

The test setup on the remote server (up-to-date Ubuntu) looks something like 
this, 
output via 'ls -l':
test/
    -rw-r--r-- 1 foobar foobar    0 Apr  8 00:31 '  
foobar-with-leading-spaces.txt'
    -rw-r--r-- 1 foobar foobar    0 Apr  8 00:31 ' foo bar with spaces .txt '
    -rw-r--r-- 1 foobar foobar    0 Apr  8 00:31  foobar-normal.txt
    -rw-r--r-- 1 foobar foobar    0 Apr  8 00:31 
'foobar-with-trailing-spaces.txt  '
    drwxr-xr-x 2 foobar foobar 4096 Apr  8 00:31 '  dir-with-leading-spaces'
    drwxr-xr-x 2 foobar foobar 4096 Apr  8 00:31 'dir-with-trailing-spaces    '
    drwxr-xr-x 2 foobar foobar 4096 Apr  8 00:31 '   dir with spaces  '


The content of the locally generated .listing file inside the "test" directory,
looks like this:
    -rw-r--r--   1 foobar   foobar          0 Apr  8 00:31   
foobar-with-leading-spaces.txt
    -rw-r--r--   1 foobar   foobar          0 Apr  8 00:31  foo bar with spaces 
.txt 
    -rw-r--r--   1 foobar   foobar          0 Apr  8 00:31 foobar-normal.txt
    -rw-r--r--   1 foobar   foobar          0 Apr  8 00:31 
foobar-with-trailing-spaces.txt  
    drwxr-xr-x   2 foobar   foobar       4096 Apr  8 00:31   
dir-with-leading-spaces
    drwxr-xr-x   2 foobar   foobar       4096 Apr  8 00:31 
dir-with-trailing-spaces    
    drwxr-xr-x   2 foobar   foobar       4096 Apr  8 00:31    dir with spaces  


The actual locally mirrored directories and files, output via OS X's 'ls - l' 
look
like this (any resource with leading spaces is obviously missing in this local 
copy
now. That's a wee-bit bad for backups when important files can be unexpectedly
M.I.A. ;) )
test/
    -rw-r--r--  1  foobar   foobar    0 Apr  8 00:31 foobar-normal.txt
    -rw-r--r--  1  foobar   foobar    0 Apr  8 00:31 
foobar-with-trailing-spaces.txt  
    drwxr-xr-x  3  foobar   foobar  102 Apr  8 00:32 dir-with-trailing-spaces   
 


In the log file (via --append-output) various errors like this are generated 
(the
leading spaces are missing), but with the return code of the command wrongly 
indicating
that the full mirror was actually a success in the end:
    ...
    No such file 'test/foobar-with-leading-spaces.txt'.
    No such file 'test/foo bar with spaces .txt '.
    No such directory 'test/dir-with-leading-spaces'.
    No such directory 'test/dir with spaces  '.
    ...



Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]