diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-21 17:21:51 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-21 17:22:12 +0100 |
commit | 0b2c9b823c7b421d4305cb25a85074dbde14bc12 (patch) | |
tree | e21770a67a1bdd365c39df0e69a7a12b3d61105e /apps/files_external | |
parent | 3e1ade4397717ccf45d0916def6559ceb921f8f3 (diff) | |
download | nextcloud-server-0b2c9b823c7b421d4305cb25a85074dbde14bc12.tar.gz nextcloud-server-0b2c9b823c7b421d4305cb25a85074dbde14bc12.zip |
Prevent using root as mount point for external storage
Fixes #5981
Diffstat (limited to 'apps/files_external')
-rwxr-xr-x | apps/files_external/lib/config.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 43643076519..de42fe2f755 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -266,6 +266,11 @@ class OC_Mount_Config { $mountType, $applicable, $isPersonal = false) { + $mountPoint = OC\Files\Filesystem::normalizePath($mountPoint); + if ($mountPoint === '' || $mountPoint === '/') { + // can't mount at root + return false; + } if ($isPersonal) { // Verify that the mount point applies for the current user // Prevent non-admin users from mounting local storage |