[Clamav-devel] SIGSEGV in Clamd when stream scanning

2005-03-26 Thread Calin A. Culianu
Hi guys, I have some strange, very reproducible segfaults in clamd on a Debian-based system. I tried 0.83 and the cvs version. I built it from source with debug symbols and static libs (to simplify debugging). Anyway, my segfaults occur only when I use clamd in a setup where I do a lot of

[Clamav-devel] Environment Variable Patch for VirusEvent

2005-03-14 Thread Calin A. Culianu
Hi guys, This is my fourth submission for an environment variable patch for VirusEvents. The other 3 I submitted all had various bugs. This patch makes the virusaction function reentrant (my previous patches broke reentrancy). It didn't occur to me initially that modifying the environment is

Re: [Clamav-devel] Question about STREAM scanning

2005-03-14 Thread Calin A. Culianu
On Mon, 14 Mar 2005, John Giammarche wrote: Hello everyone and thanks for reading my message. I want to use clamd to scan files that are uploaded to a Java Servlet. So far, I've connected to clamd and clamd answered the PORT that I should connect to send the file. So far so good. When I connect to

[Clamav-devel] Env var patch..

2005-03-12 Thread Calin A. Culianu
Hello? Is my patch going to make it into clamav? I really would like VirusEvent scripts to get the infected filename in the environment. Please accept my patch! ___ http://lurker.clamav.net/list/clamav-devel.html

[Clamav-devel] Clamuko supporting more than %v

2005-03-09 Thread Calin A. Culianu
Would anyone be opposed if I were to submit a patch so that clamuko and clamd's scanner could support more than just %v in VirusEvent strings? The function in question is clamd/others.c::virusaction(). In particular, I am thinking of supporting at least: %f - infected filename For clamuko,

Re: [Clamav-devel] Clamuko supporting more than %v

2005-03-09 Thread Calin A. Culianu
On Wed, 9 Mar 2005, Tomasz Kojm wrote: In particular, I am thinking of supporting at least: %f - infected filename It was already supported but has been removed due to security issues. Why is this a security issue? Because it's hard to implement in a secure way. Read the change log, google, ...

Re: [Clamav-devel] Clamuko supporting more than %v

2005-03-09 Thread Calin A. Culianu
On Wed, 9 Mar 2005, Jeremy Kitchen wrote: [...] well, I know they'll probably tell you that the %f flag won't be resurrected.. but it might be kinda nice to add the filename to an environment variable that the script can use... Ooooh that would be nice! Can I do that? Please?! Pretty please?!

Re: [Clamav-devel] Clamuko supporting more than %v

2005-03-09 Thread Calin A. Culianu
On Wed, 9 Mar 2005, Jeremy Kitchen wrote: Shouldn't be overly difficult to set an environment variable with the filename before calling the event program. True. Now, what to call this variable? I was thinking CLAM_VIRUSEVENT_*. Where * is one of FILENAME, VIRUSNAME, etc... How does that suit

Re: [Clamav-devel] Clamuko supporting more than %v

2005-03-09 Thread Calin A. Culianu
Also please create an example script that can use all the variables which we can put into /contrib The example script is attached... -Calin #!/bin/sh # clam_email_alert.sh # Calin A. Culianu calin at ajvar.org # # A small sample script to email alerts. To use it, put the following in your

[Clamav-devel] Patch for environment variable addition to virusaction

2005-03-09 Thread Calin A. Culianu
NOTE: This replaces my previous patch. I fixed it up to use the more compatible putenv() function which is POSIX. The setenv() function I was using before was not POSIX. Summary: This adds two environment variables for the purpose of VirusEvent when executing an external command.

[Clamav-devel] UPDATED Patch for environment variable addition to virusaction

2005-03-09 Thread Calin A. Culianu
Argh, my last two patches are bad. This one should work fine. Tomasz: Please use this one and disregard the last two I sent. This one is 100% correct -- the other one had a problem with its use of putenv(). Sheesh putenv() is a retarded function! :) diff -ur clamav-devel/clamd/clamuko.c

Re: [Clamav-devel] UPDATED Patch for environment variable addition to virusaction

2005-03-09 Thread Calin A. Culianu
On Wed, 9 Mar 2005, Andy Fiddaman wrote: This is looking good, just one problem and one comment. mcalloc() is unfortunately not portable, it's probably best that you use the ClamAV library function cli_malloc() for consistency. Hmm. Well, why do other parts of the clamd program then call

[Clamav-devel] Clamuko: Caching results

2005-03-09 Thread Calin A. Culianu
How would people feel about adding some sort of caching feature to the clamuko thread in order to cache the results of previous scans? This could dramatically speed things up for on-access scanning of often-used files.. Of course, the cache entry would have to be invalidated if the file is