aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-05-12 18:33:26 +0200
committerRobin Appelman <robin@icewind.nl>2025-05-13 18:29:00 +0200
commit1e72620169ca689d6aa3a7b1d47524bfd7bbe1b4 (patch)
treef0a8a53dc5232e7f92000c5538d2164ae22bb3c2 /lib
parent0001c22668f3901dc4ca0dee5709401fb52eaa25 (diff)
downloadnextcloud-server-nested-jail-root.tar.gz
nextcloud-server-nested-jail-root.zip
fix: fix unjailedroot of nested jails if there are other wrappers in betweennested-jail-root
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-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 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();
}
}