From 135cfd2c5573596545332787c2a77e112e98d4a3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 28 May 2019 13:52:32 +0200 Subject: [PATCH] dont use part files for dav writes when the target folder doesn't have create permissions Signed-off-by: Robin Appelman --- apps/dav/lib/Connector/Sabre/File.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 3c42f66a04a..9815059c59f 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -147,7 +147,12 @@ class File extends Node implements IFile { if ($needsPartFile) { // mark file as partial while uploading (ignored by the scanner) $partFilePath = $this->getPartFileBasePath($this->path) . '.ocTransferId' . rand() . '.part'; - } else { + + if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) { + $needsPartFile = false; + } + } + if (!$needsPartFile) { // upload file directly as the final path $partFilePath = $this->path; @@ -178,7 +183,7 @@ class File extends Node implements IFile { } $isEOF = false; - $wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function($stream) use (&$isEOF) { + $wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function ($stream) use (&$isEOF) { $isEOF = feof($stream); }); -- 2.39.5