From f33fe36dc80c5c2cd4ca7438d641d59c5ca9f649 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 20 May 2008 20:45:15 +0200 Subject: [PATCH] Display error if the script does not contain any blacklist --- dowkd.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dowkd.in b/dowkd.in index e492a7d..966a441 100644 --- a/dowkd.in +++ b/dowkd.in @@ -85,13 +85,16 @@ sub create_db () { $db = tie %db, 'DB_File', $db_file, O_RDWR | O_CREAT, 0777, $DB_BTREE or die "error: could not open database: $!\n"; + my $found; while (my $line = ) { next if $line =~ /^\**$/; chomp $line; $line =~ /^[0-9a-f]{32}$/ or die "error: invalid data line"; $line =~ s/(..)/chr(hex($1))/ge; $db{$line} = ''; + $found = 1; } + $found or die "error: no blacklist data found in script\n"; # Set at the end so that no incomplete database is left behind. $db{''} = $db_version; -- 2.11.4.GIT