[Pkg-owncloud-commits] [owncloud] 13/73: Don't return file handle if the mode supports writing and the file is not writable

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:08:58 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.0.10
in repository owncloud.

commit e9a63900dee88447efebeb66b3954fdaeffbe73a
Author: Michael Gapczynski <mtgap at owncloud.com>
Date:   Wed Aug 8 11:25:24 2012 -0400

    Don't return file handle if the mode supports writing and the file is not writable
    
    Conflicts:
    	apps/files_sharing/sharedstorage.php
---
 apps/files_sharing/sharedstorage.php |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 41af077..7a90581 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);
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list