From: Daniel Vedder Date: Sat, 2 May 2020 12:41:54 +0000 (+0200) Subject: Resolve symlinks when checking for registered paths. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~251^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0743a0b502154caa4ceebf9f7acb7b78f6174705;p=nextcloud-desktop.git Resolve symlinks when checking for registered paths. Fixes issue #1948: https://github.com/nextcloud/desktop/issues/1948 The client already resolves symlinks when adding new paths to the sync-list, but the Nautilus plugin did not do this yet, causing it to not recognise synced folders if they were accessed via a symlink. Signed-off-by: Daniel Vedder --- diff --git a/shell_integration/nautilus/syncstate.py b/shell_integration/nautilus/syncstate.py index 84a13161c..c90c20aa4 100644 --- a/shell_integration/nautilus/syncstate.py +++ b/shell_integration/nautilus/syncstate.py @@ -191,11 +191,12 @@ class MenuExtension(GObject.GObject, Nautilus.MenuProvider): def check_registered_paths(self, filename): topLevelFolder = False internalFile = False + absfilename = os.path.realpath(filename) for reg_path in socketConnect.registered_paths: - if filename == reg_path: + if absfilename == reg_path: topLevelFolder = True break - if filename.startswith(reg_path): + if absfilename.startswith(reg_path): internalFile = True # you can't have a registered path below another so it is save to break here break @@ -447,6 +448,7 @@ class SyncStateExtension(GObject.GObject, Nautilus.InfoProvider): return filename = get_local_path(item.get_uri()) + filename = os.path.realpath(filename) if item.is_directory(): filename += os.sep