Re: Could not open dir (/var/lib/amavis/tmp
[email protected] Wed, 13 Apr 2005 11:46:35 -0700 (PDT)
| Newsgroups | gmane.comp.security.virus.vtools |
|---|---|
| Message-ID | <[email protected]> |
Are you using a new-ish linux as your server? I've run into what
looks like the same problem here. We're running Redhat Enterprise 4.
I've found two potential solutions. The first is that you can
change your amavisd config "ask_daemon" line:
\&ask_daemon, ["{}/\n", '/var/run/sophie'],
to
\&ask_daemon, ["{}/*\n", '/var/run/sophie'],
I haven't really tested this much, but it seemed to work. The
other potential solution I've seen mention of on the net is to
patch the sophie_scandir.c source (see diff below). I'm not
clear on the real problem (not up on the fine points of readdir()
and the various linux releases), but the patch does seem to work.
This is what we're running with now.
----------------------------------------------------------
*** sophie_scandir.c 2005/04/07 19:25:15 1.1
--- sophie_scandir.c 2005/04/07 20:39:55
***************
*** 34,44 ****
--- 34,51 ----
}
/* Let's get rid of '.' and '..' */
+ /*
direntry = readdir(dirpt);
direntry = readdir(dirpt);
+ */
while ((direntry = readdir(dirpt)))
{
+ /* Let's get rid of '.' and '..' properly*/
+ if((strcmp(direntry->d_name,".")==0)||(strcmp(direntry->d_name,"..")==0))
+ {
+ continue;
+ }
memset(path, 0, sizeof(path));
strncat(path, dirpath, sizeof(path)-1);
strncat(path, "/", sizeof(path)-1);
----------------------------------------------------------
Let me know if the diff output doesn't make sense.
-glenn
> From: Anne <[email protected]>
> Date: Wed, 13 Apr 2005 12:45:55 +0200
>
> I'm using Sophie 3.04rc2 with Sophos, Postfix and amavisd-new. On my last
> install I cannot use Sophie any more. I can start Sophie without any problem.
>
> I configured amavisd-new in amavisd.conf :
> ...
> @av_scanners = (
>
> ### http://www.vanja.com/tools/sophie/
> ['Sophie',
> \&ask_daemon, ["{}/\n", '/var/run/sophie'],
> qr/(?x)^ 0+ ( : | [\000\r\n]* $)/, qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
> qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
> );
>
> @av_scanners_backup = (
> ### http://www.sophos.com/
> ['Sophos Anti Virus (sweep)', 'sweep',
> '-nb -f -all -rec -ss -sc -archive -cab -tnef --no-reset-atime {}',
> [0,2], qr/Virus .*? found/,
> qr/^>>> Virus(?:(?: fragment)? '?(.+?)'? found)/,
> ],
> );
>
> When I restart amavis, and receive my first messages, I get this error
> message :
> Apr 13 12:41:31 balvy sophie[13505]: WARNING : Could not open dir
> (/var/lib/amavis/tmp/amavis-20050413T124129-13380/parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/..
> Apr 13 12:41:31 balvy sophie[13505]: WARNING : Could not open dir
> (/var/lib/amavis/tmp/amavis-20050413T124129-13380/parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/../parts/..
> ...
>
> Any idea ?
>
> Regards
>
> --
> Anne
> http://lea-linux.org
> _______________________________________________
> vtools mailing list
> [email protected]
> http://www.vanja.com/list/listinfo.cgi/vtools
>