Package: ftpmirror
Version: 1.96+dfsg-16+b1
Severity: normal

Dear Maintainer,

I found that ftpmirror does not handle filenames with leading or trailing
spaces in unix directory listings. To make matters worse, the error
message one gets is not very helpful:

   get_misc: can't get array at blib/lib/Fan.pm (autosplit into 
blib/lib/auto/Fan/run_full_mirror.al) line 1269.

and then ftpmirror crashes.

An example file listing where this happens looks like this:

drwxr-xr-x   2 ftp      ftp             4 Mar 15  2007  the dir to look at
drwxr-xr-x   2 ftp      ftp             4 Mar 15  2007 trailing spaces 

I found it works pretty reliable again after editing
/usr/lib/ftpmirror/auto/Fan/Attrib/from_list.al and changing these lines:

        # kill leading/trailing spaces, and trailing slash
        s/^\s+//; s/\s+$//; s/\/$//;

to:

        # kill leading space and trailing slash
        s/^\s//; s/\/$//;

i.e. instead of removing all whitespace, it only removes the single
whitespace after the file time, and never removes trailing whitespace.

I'm not sure trailing whitespace actually exists in reality, but I can
imagine extra whitespace after the date, although I haven't seen this yet.

Given the age of ftpmirror, I'm not really expecting much action here,
maybe a patch or note might be useful though.

(I use ftpmirror because, although lftp is quite reliable, it also lacks
a lot of the options of ftpmirror, e.g. it can't exclude paths, so it's
still useful :)

-- System Information:
Debian Release: 10.2
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable-debug'), (500, 'testing-debug'), 
(500, 'stable-updates'), (500, 'stable-debug'), (500, 'oldstable-updates'), 
(500, 'oldstable-debug'), (500, 'unstable'), (500, 'testing'), (500, 
'oldstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32

Kernel: Linux 5.4.7-050407-generic (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ftpmirror depends on:
ii  libc6                       2.28-10
ii  perl                        5.28.1-6
ii  perl-base [perlapi-5.28.0]  5.28.1-6
pn  perlapi-5.24.1              <none>
pn  perlapi-5.30.0              <none>

Versions of packages ftpmirror recommends:
ii  cron  3.0pl1-134+deb10u1

ftpmirror suggests no packages.

Reply via email to