[Xfce4-commits] [apps/catfish] 02/02: Do not search real paths that are above the starting path

noreply at xfce.org noreply at xfce.org
Thu Dec 19 12:33:22 CET 2019


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/catfish.

commit 56a3d50442d8509fcdce644251e1a14dc476871e
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Thu Dec 19 06:33:15 2019 -0500

    Do not search real paths that are above the starting path
---
 ChangeLog                      |  2 ++
 catfish/CatfishSearchEngine.py | 11 +++++++++++
 po/catfish.pot                 |  2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ea9ea2f..9a55586 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@ v1.4.11 (unreleased):
    - Fix crashes when GdkDisplay or GdkScreen calls return None (LP: #1822914)
    - Fix configuration of preferred window layout (Xfce #16085)
    - Fix finding files in the target directory (Xfce #15985, #16233)
+   - Fix symbolic link looping (Xfce #16272)
+   - Do not search real paths that are above the starting path
 
 v1.4.10:
  + New Features:
diff --git a/catfish/CatfishSearchEngine.py b/catfish/CatfishSearchEngine.py
index 178c1f5..29ed554 100644
--- a/catfish/CatfishSearchEngine.py
+++ b/catfish/CatfishSearchEngine.py
@@ -305,6 +305,9 @@ class CatfishSearchMethod_Walk(CatfishSearchMethod):
         dotlinks = []
         notdotdirs = []
         notdotlinks = []
+
+        realroot = os.path.realpath(root)
+
         for path in dirs:
             path = os.path.join(root, path)
             # Remove trailing slashes to ensure that calling os.path.basename()
@@ -320,6 +323,14 @@ class CatfishSearchMethod_Walk(CatfishSearchMethod):
                 realpath = os.path.realpath(path)
                 if realpath in processed_links:
                     continue
+                # Respect the user's settings
+                if realpath in exclude_list:
+                    continue
+                # Sandbox search results to the starting path, don't allow:
+                # Start: /home/username/
+                # Link: ~/.wine/dosdevices/z:/ -> /
+                if realroot.startswith(realpath):
+                    continue
                 processed_links.append(realpath)
             if os.path.basename(path).startswith("."):
                 if islink:
diff --git a/po/catfish.pot b/po/catfish.pot
index e5e789f..d41f52d 100644
--- a/po/catfish.pot
+++ b/po/catfish.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-12-19 05:42-0500\n"
+"POT-Creation-Date: 2019-12-19 06:32-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list