summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-09-06 17:07:49 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-09-06 17:10:21 +0200
commite7b1c9adc78a637f1ff9f10c4a2be80377c70fa6 (patch)
treef659a22be665e975bbd77366c3d7c616d77cabb6
parent870ebec4ac1f5528a83969253a5994ab5ee1a414 (diff)
downloadnextcloud-server-e7b1c9adc78a637f1ff9f10c4a2be80377c70fa6.tar.gz
nextcloud-server-e7b1c9adc78a637f1ff9f10c4a2be80377c70fa6.zip
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 <roeland@famdouma.nl>
-rw-r--r--apps/files_sharing/lib/SharedStorage.php10
1 files 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);