From: Robin Appelman Date: Fri, 20 Jun 2014 14:09:38 +0000 (+0200) Subject: Dont allow opening writable streams on a read only dav mount X-Git-Tag: v7.0.0beta1~18^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d24c0f4d42f679e9014e419d8d2bd5fe88ab7e42;p=nextcloud-server.git Dont allow opening writable streams on a read only dav mount --- 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'));