]> source.dussan.org Git - nextcloud-server.git/commitdiff
Dont allow opening writable streams on a read only dav mount
authorRobin Appelman <icewind@owncloud.com>
Fri, 20 Jun 2014 14:09:38 +0000 (16:09 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 23 Jun 2014 12:35:19 +0000 (14:35 +0200)
apps/files_external/lib/webdav.php

index c532c5eaa7d14426752e1521b7a7d767c430a39f..8536c65ace9fbd38f23a44d9f4dc06de3d4c8931 100644 (file)
@@ -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'));