Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: devel

rmdirs... and a fix for "mbox.c" !

 

 

ClamAV devel RSS feed   Index | Next | Previous | View Threaded


James at kyzo

Aug 28, 2003, 6:29 AM

Post #1 of 1 (666 views)
Permalink
rmdirs... and a fix for "mbox.c" !

I was having problems with "rmdirs" going into spinloops when called
from "clamscan", so I re-coded it - attached.

I've also devised my own "quick and dirty" solution to the problem of
"clamd" crashing and leaking memory. Seeing as the problem seems to be
mainly in "mbox" i've ditched it and replaced it with "ripmime". On the
375 test messages I have been using it is also 12 seconds faster (89
secs down to 77 secs).

So, here's my new "mbox.c" :-

--------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>


#define RIPMIME "/usr/local/bin/ripmime"

int cl_mbox(const char *dir, int desc)
{
int ret,stat;

ret = fork();
if (ret==-1) return -1;
if (ret==0)
{
if (desc) dup2(desc,0);
execlp(RIPMIME,RIPMIME,"-d",dir,"-i","-",NULL);
exit(-1);
}
waitpid(ret,&stat,0);
return 0;
}
--------------------------------------------------------------



James
Attachments: rmdirs.txt (0.97 KB)

ClamAV devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.