From 2439b7ca1263811c03fb0ed82d0c012eb9171585 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 3 Jan 2021 23:29:46 +0100 Subject: [PATCH] Handle special path names --- lib/private/Files/Storage/Local.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 208ac00b5b..66aa0f16c2 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -465,7 +465,7 @@ class Local extends \OC\Files\Storage\Common { if ($realPath) { $realPath = $realPath . '/'; } - if ($fileExists && substr($fullPath, 0, strlen($realPath)) === $realPath) { + if ($fileExists && rtrim($fullPath, '/.') === $fullPath && substr($fullPath, 0, strlen($realPath)) === $realPath) { \OCP\Util::writeLog('core', "Cyclic symlinks are not allowed ('$fullPath' -> '$realPath')", ILogger::ERROR); } elseif (substr($realPath, 0, $this->dataDirLength) === $this->realDataDir) { return $fullPath;