summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-05-28 13:52:32 +0200
committerMorris Jobke <hey@morrisjobke.de>2019-07-03 16:36:27 +0200
commit50dbc9a53664abedeaeb27727b109ab3e48afbf3 (patch)
tree36e326ed0d661e07ee2762b59e5daf6e0900c05f /apps
parenta528942c2473ce25f0252b70bcf6a613e17195a6 (diff)
downloadnextcloud-server-50dbc9a53664abedeaeb27727b109ab3e48afbf3.tar.gz
nextcloud-server-50dbc9a53664abedeaeb27727b109ab3e48afbf3.zip
dont use part files for dav writes when the target folder doesn't have create permissions
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index 2f7bd804e3a..f183013f91f 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);
});