[tracker-miners/wip/carlosg/no-recurse-mountpoints] libtracker-miner: Do not recurse into mount points unless configured




commit 629f4646ee7804b27cd4c83fa98b865efae85ac2
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jan 12 23:17:14 2022 +0100

    libtracker-miner: Do not recurse into mount points unless configured
    
    Make TrackerFileNotifier stop recursing at folders that are mountpoints,
    this makes all files indexed in a TrackerIndexingTree root be implicitly
    from the same mount point.
    
    If there are mount points in recursively indexed folders that any user
    wants indexed, these will have to be configured as indexed folders
    themselves.
    
    Closes: https://gitlab.gnome.org/GNOME/tracker/-/issues/85

 src/libtracker-miner/tracker-crawler.c       | 1 +
 src/libtracker-miner/tracker-file-notifier.c | 1 +
 2 files changed, 2 insertions(+)
---
diff --git a/src/libtracker-miner/tracker-crawler.c b/src/libtracker-miner/tracker-crawler.c
index a20e9fdc7..ecab6ed4a 100644
--- a/src/libtracker-miner/tracker-crawler.c
+++ b/src/libtracker-miner/tracker-crawler.c
@@ -26,6 +26,7 @@
 #include "tracker-utils.h"
 
 #define FILE_ATTRIBUTES          \
+       G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "," \
        G_FILE_ATTRIBUTE_STANDARD_NAME "," \
        G_FILE_ATTRIBUTE_STANDARD_TYPE "," \
        G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 7f9bf367f..d3664e74a 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -445,6 +445,7 @@ file_notifier_add_node_foreach (GNode    *node,
 
                if (file_type == G_FILE_TYPE_DIRECTORY &&
                    (priv->current_index_root->flags & TRACKER_DIRECTORY_FLAG_RECURSE) != 0 &&
+                   !g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT) &&
                    !G_NODE_IS_ROOT (node)) {
                        /* Queue child dirs for later processing */
                        g_assert (node->children == NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]