[clamav-users] Could not watch path /var/lib/docker/overlay2 error

Arthur Ramsey arthurramsey19 at gmail.com
Thu Oct 10 20:25:55 EDT 2019


After more testing this seems better:

--- a/clamd/onaccess_hash.c 2019-10-10 19:19:06.000000000 -0500
+++ b/clamd/onaccess_hash.c    2019-10-10 19:14:23.000000000 -0500
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <errno.h>
 #include <stdbool.h>
+#include <mntent.h>
 
 #include <sys/fanotify.h>
 
@@ -589,6 +590,22 @@
 
      struct onas_hnode *hnode = NULL;
 
+        char buf[10240];
+        struct mntent ent;
+        struct mntent *mntent;
+        FILE *mountinfo;
+        mountinfo = setmntent("/proc/mounts", "r");
+        if (mountinfo == NULL) {
+            logg("!ScanOnAccess: setmntent failed\n");
+            return CL_EARG;
+        }
+        while ((mntent = getmntent_r(mountinfo, &ent, buf, sizeof(buf))) != NULL) {
+            if (strcmp(curr->fts_path, pathname) != 0 && strcmp(curr->fts_path, mntent->mnt_dir) == 0) {
+                onas_ht_add_hierarchy(ht, curr->fts_path);
+            }
+        }
+        endmntent(mountinfo);
+
      /* May want to handle other options in the future. */
      switch (curr->fts_info) {
         case FTS_D:



More information about the clamav-users mailing list