On Wed, 6 Aug 2003, Tomasz Kojm wrote:
>
> On Wed, 6 Aug 2003 15:05:46 +0000 (UTC)
> Julien Benoist <[EMAIL PROTECTED]> wrote:
>
> >
> > Is there a trivial way to scan strings *with* CL_ARCHIVE & CL_MAIL support
> > ?
>
> No, there isn't.
>
> >   pipe(pfd);
> >   write(pfd[1],buffer,strlen(buffer));
> >   close(pfd[1]);
>
> First thing - the code above is broken. When working with a binary data, strlen
> will return a false size of the buffer, because it's almost sure there's the
> terminating \0 character in the buffer.

Hmmm, I forgot to tell... this piece of code will only scan mails (where
data is MIME encoded).

>
> You should save all data to a temporary file and run cl_scandesc on it.

Agreed, but i actually wanted to avoid it for performance reasons.

>
> > throught, it seamed to detect file types, as cl_perror() would return "RAR
> > module failure" with one of the files in the test/ dir.
>
> rarfail.rar is a winrar 3.0 archive and the internal rar library can't handle it.

ok for the rarfail.rar file, but cl_perror() also returned some "ZIP
module failure" while scanning some other files (it did work with ex1.c).
Throught, in the above code, replacing this fd to pipe by a fd to file
worked pretty well.

kind regards,


Julien Benoist


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to