]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent using root as mount point for external storage
authorVincent Petry <pvince81@owncloud.com>
Thu, 21 Nov 2013 16:21:51 +0000 (17:21 +0100)
committerVincent Petry <pvince81@owncloud.com>
Thu, 21 Nov 2013 16:22:12 +0000 (17:22 +0100)
Fixes #5981

apps/files_external/lib/config.php

index 43643076519ec7b795055bd07c212e94cce8e21a..de42fe2f755e69721e63d562f7c5d3cbd7293274 100755 (executable)
@@ -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