Ben Kennedy wrote:
On 10 8 2004 at 4:08 pm -0400, Michael Carmack wrote:

The pipe is necessary if you are running clamd as a different user than courier. For example, on my system clamd runs as the 'clamav' user, and courier runs as the 'courier' user. If the second approach is working for you, you must be running clamd and courier as the same user. (Personally I think this is not a good idea.)

Hmmm. Well since it is clamdscan which is reading the message, I presume you are implying that it should be set{u|g}id clamav, but apparently mine is not:

-rwxr-xr-x  1 root root 21304 Aug 10 09:34 /usr/bin/clamdscan

Should it be? (If so I'll file this as a gentoo bug...)

No, I'm referring to clamd, not clamdscan. If you look in etc/clamav.conf you'll see a line that says "User <xxx>". I'm guessing that on your system "<xxx>" is the same user that you run courier as (e.g. "nobody" is a common choice). Otherwise the direct file read would not have worked for you.


(clamd and clamdscan are funny like that. You'd think that you could run clamdscan on any file that was readable by the person calling clamdscan, but that is not the case. The file actually has to be readable by clamd. Instead of clamdscan passing the contents of the file to clamd, it passes the filename and expects clamd to do the reading. You can see the problem if you save a virused email, change it so that it is not world-readable (just user-readable), and try to run clamdscan on it. Even though you can read the file, you'll get an access denied error when running clamdscan on it.)


Nonetheless I still don't understand why your original code was hanging
my system.  If courier wrote the message file and is invoking the command
line, there should be no permission problem with the cat...

It's not a permission problem. It was hanging because of the bug in 0.75 that was fixed in 0.75.1; cat sends the file contents to clamd on stdin, and 0.75 had a problem with stdin scanning.


The permission problem is when you try to read the file directly (without using cat). You just don't see that problem on your system because you are running clamd as the same user as courier.

m.



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to