Is there a trivial way to scan strings *with* CL_ARCHIVE & CL_MAIL support
?

As cl_clambuff() doesnt support these features, i tried to cheat with a
UNIX pipe :

  char *buffer;
  int pfd[2];

  /* ...
   * buffer malloced & contains data
   * ...
   */

  pipe(pfd);
  write(pfd[1],buffer,strlen(buffer));
  close(pfd[1]);

  /* ...
   * various libclamav initialisations
   * ...
   */

   if((ret = cl_scandesc(fd, &virusname, &size, root, &limits,
                        CL_ARCHIVE | CL_MAIL)) == CL_VIRUS) {
         syslog(LOG_DEBUG,"Detected %s virus", virusname);
   } else {
         syslog(LOG_DEBUG,"No virus dected");
         if(ret != CL_CLEAN)
               syslog(LOG_CRIT,"Error: %s\n", cl_perror(ret));
   }


The following never worked. cl_scandesc() never returns CL_VIRUS,
throught, it seamed to detect file types, as cl_perror() would return "RAR
module failure" with one of the files in the test/ dir.

--
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