From e7b1c9adc78a637f1ff9f10c4a2be80377c70fa6 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 6 Sep 2018 17:07:49 +0200 Subject: Properly check share permissions isCreatable only works on folders isUpdatable if the file is not there but it is a part file also has to be checked on the folder Signed-off-by: Roeland Jago Douma --- apps/files_sharing/lib/SharedStorage.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index 77019e25265..34a21fcd637 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -258,11 +258,17 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto case 'xb': case 'a': case 'ab': - $creatable = $this->isCreatable($path); + $creatable = $this->isCreatable(dirname($path)); $updatable = $this->isUpdatable($path); // if neither permissions given, no need to continue if (!$creatable && !$updatable) { - return false; + if (pathinfo($path, PATHINFO_EXTENSION) === 'part') { + $updatable = $this->isUpdatable(dirname($path)); + } + + if (!$updatable) { + return false; + } } $exists = $this->file_exists($path); -- cgit v1.2.3