Don't return file handle if the mode supports writing and the file is not writable
This commit is contained in:
parent
0bf2a3e6d6
commit
05648dac61
|
@ -367,6 +367,25 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
|
|||
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;
|
||||
}
|
||||
}
|
||||
$info = array(
|
||||
'target' => $this->datadir.$path,
|
||||
'source' => $source,
|
||||
|
|
Loading…
Reference in New Issue