[tracker-miners/wip/carlosg/indexed-folder-checks: 2/2] libtracker-miner: Check that files in the TrackerIndexingTree are folders




commit 3172a281c9a7929ba7eeb30efd06f115445babd3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 9 14:35:05 2021 +0200

    libtracker-miner: Check that files in the TrackerIndexingTree are folders
    
    Ensure that these are either folders themselves, or symlinks to folders.

 src/libtracker-miner/tracker-indexing-tree.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/libtracker-miner/tracker-indexing-tree.c b/src/libtracker-miner/tracker-indexing-tree.c
index b72168d02..5a3454e9f 100644
--- a/src/libtracker-miner/tracker-indexing-tree.c
+++ b/src/libtracker-miner/tracker-indexing-tree.c
@@ -508,6 +508,9 @@ tracker_indexing_tree_add (TrackerIndexingTree   *tree,
 
        g_return_if_fail (TRACKER_IS_INDEXING_TREE (tree));
        g_return_if_fail (G_IS_FILE (directory));
+       g_return_if_fail (g_file_query_file_type (directory,
+                                                 G_FILE_QUERY_INFO_NONE,
+                                                 NULL) == G_FILE_TYPE_DIRECTORY);
 
        priv = tree->priv;
        node = find_directory_node (priv->config_tree, directory,


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