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

Prevent using root as mount point for external storage

Fixes #5981
parent 3e1ade43
No related branches found
No related tags found
No related merge requests found
...@@ -266,6 +266,11 @@ class OC_Mount_Config { ...@@ -266,6 +266,11 @@ class OC_Mount_Config {
$mountType, $mountType,
$applicable, $applicable,
$isPersonal = false) { $isPersonal = false) {
$mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
if ($mountPoint === '' || $mountPoint === '/') {
// can't mount at root
return false;
}
if ($isPersonal) { if ($isPersonal) {
// Verify that the mount point applies for the current user // Verify that the mount point applies for the current user
// Prevent non-admin users from mounting local storage // Prevent non-admin users from mounting local storage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment