From 1e72620169ca689d6aa3a7b1d47524bfd7bbe1b4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 12 May 2025 18:33:26 +0200 Subject: fix: fix unjailedroot of nested jails if there are other wrappers in between Signed-off-by: Robin Appelman --- lib/private/Files/Cache/Wrapper/CacheJail.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index 24050dce0c9..5bc4ee8529d 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -31,10 +31,13 @@ class CacheJail extends CacheWrapper { ) { parent::__construct($cache, $dependencies); - if ($cache instanceof CacheJail) { - $this->unjailedRoot = $cache->getSourcePath($root); - } else { - $this->unjailedRoot = $root; + $this->unjailedRoot = $root; + $parent = $cache; + while ($parent instanceof CacheWrapper) { + if ($parent instanceof CacheJail) { + $this->unjailedRoot = $parent->getSourcePath($this->unjailedRoot); + } + $parent = $parent->getCache(); } } -- cgit v1.2.3