define set of recommended scan options

git-svn: trunk@827
remotes/push_mirror/metadata
Tomasz Kojm 22 years ago
parent 6ef42bc3e2
commit 64d54968b6
  1. 5
      clamav-devel/ChangeLog
  2. 7
      clamav-devel/examples/ex1.c
  3. 2
      clamav-devel/libclamav/clamav.h

@ -1,3 +1,8 @@
Sat Sep 4 23:27:12 CEST 2004 (tk)
----------------------------------
* libclamav/clamav.h: define set of recommended scan options (CL_STDOPT)
* examples/ex1.c: update
Sat Sep 4 23:07:05 CEST 2004 (tk)
----------------------------------
* clamscan: add support for special files in stdin mode

@ -73,20 +73,19 @@ int main(int argc, char **argv)
limits.maxratio = 200; /* maximal compression ratio */
limits.archivememlim = 0; /* disable memory limit for bzip2 scanner */
/* scan descriptor (with archive and mail scanning enabled) */
if((ret = cl_scandesc(fd, &virname, &size, root, &limits, CL_ARCHIVE | CL_MAIL | CL_OLE2)) == CL_VIRUS)
/* scan descriptor */
if((ret = cl_scandesc(fd, &virname, &size, root, &limits, CL_STDOPT)) == CL_VIRUS)
printf("Virus detected: %s\n", virname);
else {
printf("No virus detected.\n");
if(ret != CL_CLEAN)
printf("Error: %s\n", cl_perror(ret));
}
close(fd);
mb = size * (CL_COUNT_PRECISION / 1024) / 1024.0;
printf("Data scanned: %2.2Lf Mb\n", mb);
cl_free(root);
close(fd);
exit(ret == CL_VIRUS ? 1 : 0);
}

@ -76,6 +76,8 @@ extern "C"
#define CL_BROKEN 128
#define CL_MAILURL 256
/* recommended options */
#define CL_STDOPT (CL_ARCHIVE | CL_MAIL | CL_OLE2 | CL_HTML | CL_PE)
struct cli_bm_patt {
char *pattern;

Loading…
Cancel
Save