From a704bcf97f9c1baadd3a6f8497bcc9f9c2f4f195 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 1 Jun 2022 14:10:38 +0200 Subject: [PATCH] Trim mount point before matching in encryption code Often times the mount point has a leading slash. This fix sanitizes it to make sure matching works. Signed-off-by: Vincent Petry --- lib/private/Encryption/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index 693e24c4721..174af2e8b89 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -304,7 +304,7 @@ class Util { $storageService = \OC::$server->get(GlobalStoragesService::class); $storages = $storageService->getAllStorages(); foreach ($storages as $storage) { - if (strpos($path, '/files/' . $storage->getMountPoint()) === 0) { + if (strpos($path, '/files/' . ltrim($storage->getMountPoint(), '/')) === 0) { if ($this->isMountPointApplicableToUser($storage, $uid)) { return true; } -- 2.39.5