]> source.dussan.org Git - nextcloud-server.git/commitdiff
Now also preventing the user of "Shared" as mountpoint
authorVincent Petry <pvince81@owncloud.com>
Fri, 22 Nov 2013 17:36:27 +0000 (18:36 +0100)
committerVincent Petry <pvince81@owncloud.com>
Fri, 22 Nov 2013 17:36:27 +0000 (18:36 +0100)
apps/files_external/lib/config.php
apps/files_external/tests/mountconfig.php

index de42fe2f755e69721e63d562f7c5d3cbd7293274..aaa6c5be1a0401f7bea55179411b48087152de3e 100755 (executable)
@@ -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) {
index 77241c4dd2a597bb2358e4d284a5d3187620df9f..941aec680bbb1be0794a1ec7579498d8d8a248df 100644 (file)
@@ -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));
 
        }
 }