aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-05-12 18:33:26 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-05-15 10:18:10 +0000
commit143ef833e118a248c1f714610714fc0146d7658b (patch)
tree3c754dc8b21ee998fbbb3d399764f134f149de51
parent261c1ac0c532380c5ee3fe282aeae9410f467b56 (diff)
downloadnextcloud-server-backport/52775/stable29.tar.gz
nextcloud-server-backport/52775/stable29.zip
fix: fix unjailedroot of nested jails if there are other wrappers in betweenbackport/52775/stable29
Signed-off-by: Robin Appelman <robin@icewind.nl> [skip ci]
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index 3ad0d7a0a35..c6700932779 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -55,10 +55,13 @@ class CacheJail extends CacheWrapper {
parent::__construct($cache, $dependencies);
$this->root = $root;
- 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();
}
}