summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-20 16:09:38 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-23 14:35:19 +0200
commitd24c0f4d42f679e9014e419d8d2bd5fe88ab7e42 (patch)
tree29260c81c667b914cb472fbae73a6eaa72582ead /apps
parent81ecbbb0614ecfe9953d813f92424f299a1e2834 (diff)
downloadnextcloud-server-d24c0f4d42f679e9014e419d8d2bd5fe88ab7e42.tar.gz
nextcloud-server-d24c0f4d42f679e9014e419d8d2bd5fe88ab7e42.zip
Dont allow opening writable streams on a read only dav mount
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/webdav.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index c532c5eaa7d..8536c65ace9 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -209,8 +209,14 @@ class DAV extends \OC\Files\Storage\Common {
$ext = '';
}
if ($this->file_exists($path)) {
+ if (!$this->isUpdatable($path)) {
+ return false;
+ }
$tmpFile = $this->getCachedFile($path);
} else {
+ if (!$this->isCreatable(dirname($path))) {
+ return false;
+ }
$tmpFile = \OCP\Files::tmpFile($ext);
}
\OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack'));