diff options
author | Robin Appelman <robin@icewind.nl> | 2025-05-12 18:33:26 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2025-05-14 20:08:02 +0200 |
commit | 195358eb8e722469ee870175e82d82730aa5ea24 (patch) | |
tree | e05c52677ade1fe5bbfbe6ec797c59c52fc39325 | |
parent | e5aabded60be959793aec32529e57754ad13842b (diff) | |
download | nextcloud-server-backport/52775/stable30.tar.gz nextcloud-server-backport/52775/stable30.zip |
fix: fix unjailedroot of nested jails if there are other wrappers in betweenbackport/52775/stable30
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 7c4efe479cd..dd37a6266d2 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -76,7 +76,7 @@ class Cache extends CacheJail { return $this->root; } - protected function getGetUnjailedRoot() { + public function getGetUnjailedRoot() { return $this->sourceRootInfo->getPath(); } diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php index d940ca6354e..499e7c815d8 100644 --- a/lib/private/Files/Cache/Wrapper/CacheJail.php +++ b/lib/private/Files/Cache/Wrapper/CacheJail.php @@ -35,10 +35,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(); } } |