From abc1ccc8f1bb0fa4737851867c533ad72940ba57 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 9 Apr 2018 11:33:42 -0600 Subject: [PATCH] Trying to share a symlink actually uses the link target instead --- api/src/Vfs/Sharing.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/Vfs/Sharing.php b/api/src/Vfs/Sharing.php index 3e912bfb4d..8abc61b760 100644 --- a/api/src/Vfs/Sharing.php +++ b/api/src/Vfs/Sharing.php @@ -442,6 +442,12 @@ class Sharing $path = 'vfs://default'.($path[0] == '/' ? '' : '/').$path; } + // We don't allow sharing links, share target instead + if($target = Vfs::readlink($path)) + { + $path = $target; + } + if (($exists = ($stat = Vfs::stat($path)) && Vfs::check_access($path, Vfs::READABLE, $stat))) { $vfs_path = $path;