diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-08 11:25:24 -0400 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-08-24 14:58:48 +0200 |
commit | ffb55d5a17dc3a72b33d9ad2cedc0682e1caa567 (patch) | |
tree | 8ef27638d9a989e29d9acc603b4f07ea9e70022a /apps/files_sharing | |
parent | 360c22fd2821ed440089d7899d4c6680a0676410 (diff) | |
download | nextcloud-server-ffb55d5a17dc3a72b33d9ad2cedc0682e1caa567.tar.gz nextcloud-server-ffb55d5a17dc3a72b33d9ad2cedc0682e1caa567.zip |
Don't return file handle if the mode supports writing and the file is not writable
Conflicts:
apps/files_sharing/sharedstorage.php
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/sharedstorage.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index 8b193382838..a2dfe34402f 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -416,6 +416,25 @@ class OC_Filestorage_Shared extends OC_Filestorage { public function fopen($path, $mode) { $source = $this->getSource($path); if ($source) { + switch ($mode) { + case 'r+': + case 'rb+': + case 'w+': + case 'wb+': + case 'x+': + case 'xb+': + case 'a+': + case 'ab+': + case 'w': + case 'wb': + case 'x': + case 'xb': + case 'a': + case 'ab': + if (!$this->is_writable($path)) { + return false; + } + } $storage = OC_Filesystem::getStorage($source); return $storage->fopen($this->getInternalPath($source), $mode); } |