]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont use part files for dav writes when the target folder doesn't have create permissions
authorRobin Appelman <robin@icewind.nl>
Tue, 28 May 2019 11:52:32 +0000 (13:52 +0200)
committerBackportbot <backportbot-noreply@rullzer.com>
Wed, 3 Jul 2019 21:31:14 +0000 (21:31 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/dav/lib/Connector/Sabre/File.php

index 3c42f66a04afe595b44f269af3a6f4b991dcf7d7..9815059c59ff5143b91cc3b63c6029474da1a052 100644 (file)
@@ -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);
                                });