diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-12 19:37:59 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-12 19:38:21 +0100 |
commit | d7bf70c610425b2211d7b58d1998f052ca65a6cb (patch) | |
tree | c9900622df11ecc6be42446d5c1795b2127483ce /utils | |
parent | bb14c999b5e301f3f67edda9bc4b456ef9ef0bf1 (diff) | |
download | rspamd-d7bf70c610425b2211d7b58d1998f052ca65a6cb.tar.gz rspamd-d7bf70c610425b2211d7b58d1998f052ca65a6cb.zip |
[Fix] Fix issues with CGP helper
Diffstat (limited to 'utils')
-rw-r--r-- | utils/cgp_rspamd.pl | 14 |
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"; + } } } ); |