Hi all
i'm trying to run clamwin (clamscan) from a perl script on a Windows 2k3 Server.
And when i write "i'm trying" i mean "i'm failing".
Here's what i do:
#!/usr/bin/perl
if (@ARGV != 1) {
print "Usage: clamscan.pl <filename>\n";
exit;
}
$VirusDB = '"c:/Documents and Settings/All Users/.clamwin/db"';
my ($FILE) = @ARGV;
$cmd = '"c:/Program Files/ClamWin/bin/clamscan" --stdout --no-summary -d ' . $VirusDB . ' ' . $FILE;
$input = `$cmd`;
$input =~ m/^(.+)/;
$error_message = $1;
print "$error_message\n";
|
Now if i run that script from the command line, it get the following:
Quote: |
C:\>"c:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_security2
/clamscan.pl" c:\install.exe
W00ps!! you have something strange with this file
(maybe crt versions mismatch)
LibClamAV Error: magic_scandesc: Can't fstat descriptor 3
c:\install.exe: Can't get file status ERROR
C:\>
|
The script calls the following command line:
"c:/Program Files/ClamWin/bin/clamscan" --stdout --no-summary -d "c:/Documents a
nd Settings/All Users/.clamwin/db" c:\install.exe
Now the "funny" thing is, when i enter the identical command directly into the command line, i get this:
Quote: |
C:\>"c:/Program Files/ClamWin/bin/clamscan" --stdout --no-summary -d "c:/Documen
ts and Settings/All Users/.clamwin/db" c:\install.exe
c:\install.exe: OK
C:\>
|
Both command lines are identical. Both are called from the same user account with the same rights. What could make clamwin behaving differently? Does anyone has any idea?
Thanx a lot for your help.
inorx
[/quote]