Skip to content
Snippets Groups Projects
Commit 05648dac authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Don't return file handle if the mode supports writing and the file is not writable

parent 0bf2a3e6
No related branches found
No related tags found
No related merge requests found
...@@ -367,6 +367,25 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common { ...@@ -367,6 +367,25 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
public function fopen($path, $mode) { public function fopen($path, $mode) {
$source = $this->getSource($path); $source = $this->getSource($path);
if ($source) { 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;
}
}
$info = array( $info = array(
'target' => $this->datadir.$path, 'target' => $this->datadir.$path,
'source' => $source, 'source' => $source,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment