2bd5b90240
clamnailer uses to generate signatures.
46 lines
1.7 KiB
Plaintext
46 lines
1.7 KiB
Plaintext
$OpenBSD: patch-ClamNailer,v 1.3 2012/03/06 20:07:42 sthen Exp $
|
|
--- clamnailer.orig Tue Mar 6 20:02:07 2012
|
|
+++ clamnailer Tue Mar 6 20:04:20 2012
|
|
@@ -20,11 +20,11 @@ use strict;
|
|
use POSIX;
|
|
|
|
# clamd's database directory
|
|
-my $db = "/var/lib/clamav";
|
|
+my $db = "/var/db/clamav";
|
|
# ScamNailer download directory
|
|
-my $work = "/var/cache/clamnailer";
|
|
+my $work = "/var/db/clamnailer";
|
|
# ScamNailer download location
|
|
-my $url = "http://www.mailscanner.tv/";
|
|
+my $url = "http://cdn.mailscanner.info/";
|
|
|
|
chdir $work or die "chdir $work: $!\n";
|
|
|
|
@@ -40,7 +40,7 @@ my $base = readlink "current";
|
|
die "readlink $work/current: $!" unless defined $base or $! == ENOENT;
|
|
|
|
if (!defined $base or $base ne $latest_base) {
|
|
- system "wget --quiet $url/$latest_base" and die "wget failed\n";
|
|
+ system "ftp $url/$latest_base > /dev/null" and die "ftp failed\n";
|
|
unlink 'current', glob "$base*" if defined $base;
|
|
symlink $latest_base, 'current' or die "symlink $work/current: $!\n";
|
|
$base = $latest_base;
|
|
@@ -58,7 +58,7 @@ close $in;
|
|
|
|
for my $patch (1 .. $latest_patch) {
|
|
my $file = "$base.$patch";
|
|
- system "wget --quiet $url/$file" and die "wget failed\n" unless -f $file;
|
|
+ system "ftp $url/$file" and die "ftp failed\n" unless -f $file;
|
|
open my $in, '<', $file
|
|
or die "open $work/$file: $!\n";
|
|
while (<$in>) {
|
|
@@ -88,7 +88,7 @@ for my $addr (keys %addr) {
|
|
close $out or die "write > $work/scamnailer.tmp: $!\n";
|
|
|
|
# only install if file has changed
|
|
-if (system "diff -q scamnailer.tmp scamnailer.ndb &>/dev/null") {
|
|
+if (system "diff -q scamnailer.tmp scamnailer.ndb > /dev/null 2>&1") {
|
|
# keep a local copy for future comparisons
|
|
system "cp scamnailer.tmp scamnailer.ndb" and die "cp failed\n";
|
|
# install where clamd will pick it up
|