On Tuesday 27 May 2008 12:52 am, Dennis Peterson wrote: > Chris wrote: > > When running clamdscan against a file in my home directory I get: > > > > [EMAIL PROTECTED] ~]$ clamdscan testmsg.txt > > /home/chris/testmsg.txt: Access denied. ERROR > > The clamd daemon does no have permission to read the file. You can get > around this by redirecting the file via clamdscan: > > [EMAIL PROTECTED] ~]$ clamdscan - <testmsg.txt > > The "-" is important. This will stream the file to clamd rather than > telling clamd where the file is located. As a result it does not matter > what the permissions are because clamd does not see the file. However, > you must have permission to read the file into clamdscan. For files in > your home directory this is normally true. > > A problem with this is that it does not allow you to stream batches of > files. For that you can try using a for loop: > > To scan all files with .txt as an extension in the current directory: > > [EMAIL PROTECTED] ~]$ for file in *.txt;do > echo $file && clamdscan - < $file > done > > dp >
That's what I was missing Dennis, thanks for knocking me upside the head. I knew I had checked files with clamdscan before but just couldn't remember how. Odd that this isn't mentioned in the manpage for clamdscan. [EMAIL PROTECTED] ~]$ clamdscan - <testmsg.txt stream: Email.Spam.Gen3183.Sanesecurity.08051617 FOUND ----------- SCAN SUMMARY ----------- Infected files: 1 Time: 0.028 sec (0 m 0 s) Thanks -- Chris KeyID 0xE372A7DA98E6705C
pgpKwe2CnwIqc.pgp
Description: PGP signature
_______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://lurker.clamav.net/list/clamav-users.html