fix detection logic in treewalk() to properly work with external unpackers

git-svn: trunk@1409
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent 7afdc30996
commit d1eb32e75c
  1. 5
      clamav-devel/ChangeLog
  2. 1
      clamav-devel/clamscan/manager.c
  3. 8
      clamav-devel/clamscan/treewalk.c

@ -1,3 +1,8 @@
Sat Mar 19 01:35:04 CET 2005 (tk)
---------------------------------
* clamscan: fix detection logic in treewalk() to properly work with external
unpackers (problem reported by Stephen Gran <steve*lobefin.net>)
Sat Mar 19 00:58:19 CET 2005 (tk)
---------------------------------
* libclamav: call cli_check_jpeg_exploit() independently of pattern matcher

@ -573,6 +573,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
ret = treewalk(gendir, root, user, opt, limits, options);
/* remove the directory - as clamav */
if(!optl(opt, "leave-temps"))
clamav_rmdirs(gendir);
/* free gendir - it's not necessary now */

@ -101,12 +101,14 @@ int treewalk(const char *dirname, struct cl_node *root, const struct passwd *use
/* stat the file */
if(lstat(fname, &statbuf) != -1) {
if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode) && recursion)
treewalk(fname, root, user, opt, limits, options);
else
if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode) && recursion) {
if(treewalk(fname, root, user, opt, limits, options) == 1)
scanret++;
} else {
if(S_ISREG(statbuf.st_mode))
scanret += scanfile(fname, root, user, opt, limits, options);
}
}
free(fname);
}

Loading…
Cancel
Save