diff options
author | Robin Appelman <robin@icewind.nl> | 2025-05-12 18:33:26 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2025-05-15 14:57:05 +0200 |
commit | 465486e3358438ac2820f4294914baff31b3634f (patch) | |
tree | 08df53952742711732e2977fb8683472ca087e56 | |
parent | 66362e6b5117447b27bdec7e88584141fa698ab0 (diff) | |
download | nextcloud-server-backport/52775/stable31.tar.gz nextcloud-server-backport/52775/stable31.zip |
fix: fix unjailedroot of nested jails if there are other wrappers in betweenbackport/52775/stable31
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | apps/files_sharing/lib/Cache.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Cache/Wrapper/CacheJail.php | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index ccc93eb0952..024df5d3f43 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -68,7 +68,7 @@ class Cache extends CacheJail { return $this->root; } - protected function getGetUnjailedRoot(): string { + public function getGetUnjailedRoot(): string { return $this->sourceRootInfo->getPath(); } 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(); } } |