Problem: $DD not returning or getting populated by the return of the
command in :

sub clamscan_scanner {
  #ClamScan scanner
  &debug("clamscan: starting scan of directory \"$ENV{'TMPDIR'}\"...");

  my ($start_clamscan_time)=[gettimeofday];
  my ($DD,$clamscan_status,$stop_clamscan_time,$clamscan_time);
  my ($clamscan_verbose,$clamscan_status);
  $clamscan_verbose="-v" if ($DEBUG);

  &debug("run $clamscan_binary $clamscan_options  $ENV{'TMPDIR'} 2>&1");

  $DD=`$clamscan_binary $clamscan_options $ENV{'TMPDIR'} 2>&1`;
  $clamscan_status=($? >> 8);

  &debug("--output of clamscan was:/n$DD--");


this is logging :


Tue, 13 Jul 2004 14:44:11 -0700:3789: scanloop:
scanner=clamscan_scanner,plain_text_msg=0
Tue, 13 Jul 2004 14:44:11 -0700:3789: clamscan: starting scan of directory
"/var/spool/qmailscan/tmp/mail.server.com10897550514613789"...
Tue, 13 Jul 2004 14:44:11 -0700:3789: run /usr/local/bin/clamscan
--database=/usr/local/share/clamav/ --log=/tmp/clamav.log --unzip -r
--disable-summary --max-recursion=10 --max-space=1000000 --mbox
/var/spool/qmailscan/tmp/mail.server.com10897550514613789 2>&1

Tue, 13 Jul 2004 14:44:11 -0700:3789: --output of clamscan was:

Tue, 13 Jul 2004 14:44:11 -0700:3789: clamscan: finished scan of dir
"/var/spool/qmailscan/tmp/mail.server.com10897550514613789" in 0.591767
secs

As you can see the output is null.
I have noticed this same result in the logs in posts that claim clamscan
as not working. The command line and options are correct in the run
statement but the output variable $DD is empty and return status IS
ALWAYS 0 therefore not
triggering the rest of the quaranteening code.

when I write :

#!/usr/bin/suidperl -T
 $ENV{'PATH'}='/bin:/usr/bin';
 my ($DD,$clamscan_status);
  $DD=`/usr/local/bin/clamscan --database=/usr/local/share/clamav/
--log=/tmp/clamav.log --unzip -r --disable-summary --max-recursion=10
--max-space=1000000 --mbox mail.server.com10894740104615683 2>&1`;

 $clamscan_status=($? >> 8);

 print ("--output of clamscan was: $DD ");

 print (" Status of: $DD $clamscan_status ");

and execute as the user qscand
I get what I came for...

--output of clamscan was:
/var/spool/qmailscan/quarantine/new/mail.server.com10894740104615683:
Worm.SomeFool.P FOUND
 Status of:
/var/spool/qmailscan/quarantine/new/mail.server.com10894740104615683:
Worm.SomeFool.P FOUND 1

I cannot seem to find out why the code executed within the subroutine in
Q_S isn't returning anything. The minimum it should be pooping out for
every message processed should be:

--output of clamscan was:
/some/path/to/message/mail.server.com2786somedigits87346: OK

But it seems to be not returning anything to a great deal of those that
have posted here in the past.

All help would be appreciated

-D




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to