Skip to content
Snippets Groups Projects
Commit 2d947835 authored by Vincent Petry's avatar Vincent Petry
Browse files

Now also preventing the user of "Shared" as mountpoint

parent 476d8e6d
No related branches found
No related tags found
No related merge requests found
...@@ -267,8 +267,8 @@ class OC_Mount_Config { ...@@ -267,8 +267,8 @@ class OC_Mount_Config {
$applicable, $applicable,
$isPersonal = false) { $isPersonal = false) {
$mountPoint = OC\Files\Filesystem::normalizePath($mountPoint); $mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
if ($mountPoint === '' || $mountPoint === '/') { if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') {
// can't mount at root // can't mount at root or "Shared" folder
return false; return false;
} }
if ($isPersonal) { if ($isPersonal) {
......
...@@ -44,6 +44,8 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase { ...@@ -44,6 +44,8 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
$isPersonal = false; $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('/', $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));
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment