aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/cgp_rspamd.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/utils/cgp_rspamd.pl b/utils/cgp_rspamd.pl
index 03ecd7a94..6417646bf 100644
--- a/utils/cgp_rspamd.pl
+++ b/utils/cgp_rspamd.pl
@@ -123,10 +123,16 @@ sub rspamd_scan {
);
}
else {
- $sb = stat($file);
+ my $sb = stat($file);
if ( !$sb || $sb->size > $max_size ) {
- print "* File $file is too large: " . $sb->size . "\n$tag FAILURE\n";
+ if ($sb) {
+ print "* File $file is too large: " . $sb->size . "\n$tag FAILURE\n";
+
+ }
+ else {
+ print "* Cannot stat $file: $!\n$tag FAILURE\n";
+ }
return;
}
aio_load(
@@ -214,6 +220,10 @@ my $w = AnyEvent->io(
print "$tag OK\n";
exit 0;
}
+ else {
+ print "* Unknown command $cmd\n";
+ print "$tag FAILURE\n";
+ }
}
}
);