On Fri, 1 Oct 2004, Devin Rubia wrote:
On Wed, Sep 29, 2004 at 06:27:33PM -0400, Charles Sprickman wrote:
As you can see, I use the returncode to determine if I've got a virus or
not. The clamd-stream-client program spits out the name of the virus if
it detects one on fd 1 (STDOUT). From reading the maildrop docs, the
line:
VIRUS=`/usr/local/bin/clamd-stream-client -t 6 -d clamd.local`
should put the output of the command (the virus name) in $VIRUS. However
the log always shows that variable as empty.
What am I missing? I'd really love to have that info so I can log it, or
add it to the headers or something...
Pretty simple actually. Looks like clamdscan (et al) output to stderr
not stdout. Try this:
VIRUS=`/usr/local/bin/clamd-stream-client -t 6 -d clamd.local 2>&1`
I actually checked this earlier, and it does indeed spit out to STDOUT,
not STDERR... Any other ideas?
spork@xena[~]$ cat Klez-H.exe | clamd-stream-client -d clamd.local
Worm.Klez.H
spork@xena[~]$ cat Klez-H.exe | clamd-stream-client -d clamd.local 1> out
spork@xena[~]$ cat out
Worm.Klez.H
spork@xena[~]$ cat Klez-H.exe | clamd-stream-client -d clamd.local 2> out
Worm.Klez.H
spork@xena[~]$ cat out
spork@xena[~]$
Thanks,
Charles