Hi -

I've just started to use ClamAV as part of an evaluation of several anti-virus 
products for our UNIX/Linux networks.  Our primary need is to scan filesystems. 
The first thing I noticed was that there was no option to preserve file access 
times, this is a problem for me, since we have archive tools that make 
decisions based on the the access and modification times of files.

I double-checked the source code for "clamscan" (0.88.1) and believe that there 
is no current support for reseting the access times.  I have generated the 
following five line patch, which will always reset the access times; purhaps it 
should be a command line argument... I'll leave that up to the core developers 
to decide. Comments welcome.

*** clamscan/manager.c-dist     2006-04-06 08:39:38.023382000 -0400
--- clamscan/manager.c  2006-04-06 09:12:35.771613000 -0400
***************
*** 752,757 ****
--- 752,759 ----
  {
        int fd, ret;
        const char *virname;
+       struct stat s;
+       struct utimbuf u;


      mprintf("*Scanning %s\n", filename);
***************
*** 761,766 ****
--- 763,770 ----
        return 54;
      }

+     lstat(filename,&s);
+
      if((ret = cl_scandesc(fd, &virname, &claminfo.blocks, root, limits, 
options)) == CL_VIRUS) {
        mprintf("%s: %s FOUND\n", filename, virname);
        logg("%s: %s FOUND\n", filename, virname);
***************
*** 777,782 ****
--- 781,789 ----
            mprintf("%s: %s\n", filename, cl_strerror(ret));

      close(fd);
+     u.actime = s.st_atime;
+     u.modtime = s.st_mtime;
+     utime(filename,&u);
      return ret;
  }


_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to