timeout-failure in mailscanner

Julian Field jkf at ecs.soton.ac.uk
Wed Jan 23 15:00:57 GMT 2002


At 14:23 23/01/2002, you wrote:
>there seems to be a small, but malicious bug in mailscanners sweep.pl (all
>versions, I assume), which corrupts the killing of a timed-out virus-scan-
>process and gets mailscanner stuck, if the process can't be killed with the
>first 'kill -15' (which happened here with a .exe-attachment and
>mcafee-VirusScan)

Well spotted! It's nice to know that some users give the code a real hammering.

This problem appears at 4 locations in the entire program:
         explode.pl line 184
         sendmail.pl line 316
         sweep.pl line 349 and line 843
In all 4 occurrences, you need to change the "if" to "unless".

Please note that this is the first time this has been reported as a
problem, so I don't expect it to cause many people any trouble.

>I did some digging and ended up with the following patch (for version 3.03,
>should be quite similar for earlier versions), which solved the problem for
>my site:
>
>*** sweep.pl.orig       Wed Jan 23 14:50:20 2002
>--- sweep.pl    Wed Jan 23 14:50:34 2002
>***************
>*** 348,350 ****
>         sleep 1;
>!       ($pid=0),last if kill(0, $pid);
>         kill -15, $pid;
>--- 348,350 ----
>         sleep 1;
>!       ($pid=0),last unless kill(0, $pid);
>         kill -15, $pid;

--
Julian Field                Teaching Systems Manager
jkf at ecs.soton.ac.uk         Dept. of Electronics & Computer Science
Tel. 023 8059 2817          University of Southampton
                             Southampton SO17 1BJ



More information about the MailScanner mailing list