[Pkg-owncloud-commits] [owncloud] 76/239: Now also preventing the user of "Shared" as mountpoint

David Prévot taffit at moszumanska.debian.org
Fri Nov 29 01:32:21 UTC 2013


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

taffit pushed a commit to branch master
in repository owncloud.

commit 2d947835b94362982c98caba68aa1073ab466249
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri Nov 22 18:36:27 2013 +0100

    Now also preventing the user of "Shared" as mountpoint
---
 apps/files_external/lib/config.php        | 4 ++--
 apps/files_external/tests/mountconfig.php | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index de42fe2..aaa6c5b 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -267,8 +267,8 @@ class OC_Mount_Config {
 										 $applicable,
 										 $isPersonal = false) {
 		$mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
-		if ($mountPoint === '' || $mountPoint === '/') {
-			// can't mount at root
+		if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') {
+			// can't mount at root or "Shared" folder
 			return false;
 		}
 		if ($isPersonal) {
diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php
index 77241c4..941aec6 100644
--- a/apps/files_external/tests/mountconfig.php
+++ b/apps/files_external/tests/mountconfig.php
@@ -44,6 +44,8 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
 		$isPersonal = false;
 		$this->assertEquals(false, OC_Mount_Config::addMountPoint('', $storageClass, array(), $mountType, $applicable, $isPersonal));
 		$this->assertEquals(false, OC_Mount_Config::addMountPoint('/', $storageClass, array(), $mountType, $applicable, $isPersonal));
+		$this->assertEquals(false, OC_Mount_Config::addMountPoint('Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
+		$this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
 
 	}
 }

-- 
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