#!/usr/bin/perl # Copyright (c) 2002 Oliver Paukstadt. All rights reserved. # This program is free software; you can redistribute it # and/or modify it under the same terms as Perl itself. # wrapper for mcafee # http://www.nai.com/ $file = shift @ARGV; #if (defined $ENV{'SCAN_TMP'}) { # $ENV{'_TMP'}=$ENV{'SCAN_TMP'}; #} open(FH, "ulimit -t60 ; /usr/local/bin/uvscan --exit-on-error --summary --noexpire --mime --unzip --delete --secure '$file' |"); @msg = ; close FH; $rc = $?; if ($rc != 0) { $url = $ENV{'REQUEST_URI'}; print "Content-type: text/html\n\n"; print "Virus Found\n"; print "

Virus Alert!

"; print "while scanning $url
\n"; print "McAfee (return code $rc) reported:
".join("", @msg)."
\n"; print "\n"; unlink "$file"; } exit 1 if ($rc != 0);