poeml / mirrorbrain

MirrorBrain
http://mirrorbrain.org/
Other
75 stars 44 forks source link

scanner bails out on dir not found on FTP server #139

Closed poeml closed 9 years ago

poeml commented 9 years ago
                                                                                      [          ]

Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue139

Title    scanner bails out on dir not found on FTP server
 Priority   bug       Status      resolved
Superseder           Nosy List    dagobert, poeml
Assigned To          Keywords     scanner
msg502 (view) Author: dagobert Date: 2014-02-01.14:05:44

The scanner.pl bails out if a directory is not found on an FTP sever during scanning:

Net::FTP=GLOB(0x77e8a8)<<< 230 Anonymous access granted, restrictions apply Net::FTP=GLOB(0x77e8a8)>>> TYPE I Net::FTP=GLOB(0x77e8a8)<<< 200 Type set to I belnet: connected to ftp.belnet.be, (anonymous,/opt/csw/bin/scanner@mirror- test.opencsw.org) Net::FTP=GLOB(0x77e8a8)>>> CWD /mirrorsx/opencsw/ Net::FTP=GLOB(0x77e8a8)<<< 550 /mirrorsx/opencsw/: No such file or directory $VAR1 = '550 failed: ftp-cwd(/mirrorsx/opencsw/): '; DIE: (=> => /opt/csw/bin/scanner 317 main::ftp_readdir) Can't use string ("550 failed: ftp-cwd(/mirrorsx/op") as an ARRAY ref while "strict refs" in use at /opt/csw/bin/scanner line 804. Completed in 1 seconds

This is due to the regex match of a scalar string made against a ref to a string, this should be just a regex match against the scaler. This patch fixes the issue:

From 5ca8b992d77a3479f1081432d21f8a96382b41c6 Mon Sep 17 00:00:00 2001 From: Dagobert Michelsen dam@opencsw.org Date: Sat, 1 Feb 2014 14:56:06 +0100 Subject: [PATCH] Do not take ref on a simple scalar string or it wont match


tools/scanner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/scanner.pl b/tools/scanner.pl index ab9bcb8..4216721 100755 --- a/tools/scanner.pl +++ b/tools/scanner.pl @@ -774,7 +774,7 @@ sub ftp_readdir return unless defined $ftp; my $text = ftp_cont($ftp, "$url/$name");

fixed in r8358. Thanks!

History
         Date           User   Action            Args
                                      status: unread -> resolved
2014-02-02 12:34:49 poeml    set    nosy: + poeml
                                      messages: + msg512
2014-02-01 14:05:44 dagobert create
(end of migrated issue)