On Mon, Mar 13, 2006 at 12:17:38PM -0800, Todd Lyons wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sun, Mar 12, 2006 at 02:53:21PM +0100, MP wrote: > > >ok, that's fine, so when I need to scan a directory, I'll use clamdscan > >in the future. > > Point to note: the clamd daemon by default changes user when it starts > from root down to a regular user, usually clamav. Whatever directory or > files you need scanned will have to be readable by the user clamav. If > it's not, then you have two choices: > > 1) make clamd run as user root instead of regular user clamav (not > recommended). > 2) run clamscan when you need to scan files or directories from the > commandline.
Or use a tool that you can use on the command line that reads the file (or stdin) and sends it to the clamd daemon, if you have one running, over a network socket, and reports the basic result. I have such a thing, but it's part of a package and isn't separately buildable, otherwise I'd point to it. However, it's a fairly easy thing to write, and I would think there would be others like it out there somewhere. e.g.: 376% ls -l V total 808 -rw------- 1 mem staff 5944 Feb 27 18:47 p1.msg -rw------- 1 mem staff 796503 Mar 14 15:05 p2.msg -rw------- 1 mem staff 751 Mar 14 15:05 p3.msg 377% find V -type f -exec sh -c 'echo {} `clamdif < {} `' \; V/p1.msg HTML.Phishing.Pay-38 V/p2.msg V/p3.msg mm _______________________________________________ http://lurker.clamav.net/list/clamav-users.html