fix: fix unjailedroot of nested jails if there are other wrappers in between

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/52775/head
Robin Appelman 2025-05-12 18:33:26 +07:00
parent 0001c22668
commit 1e72620169
2 changed files with 8 additions and 5 deletions

@ -68,7 +68,7 @@ class Cache extends CacheJail {
return $this->root; return $this->root;
} }
protected function getGetUnjailedRoot(): string { public function getGetUnjailedRoot(): string {
return $this->sourceRootInfo->getPath(); return $this->sourceRootInfo->getPath();
} }

@ -31,10 +31,13 @@ class CacheJail extends CacheWrapper {
) { ) {
parent::__construct($cache, $dependencies); parent::__construct($cache, $dependencies);
if ($cache instanceof CacheJail) { $this->unjailedRoot = $root;
$this->unjailedRoot = $cache->getSourcePath($root); $parent = $cache;
} else { while ($parent instanceof CacheWrapper) {
$this->unjailedRoot = $root; if ($parent instanceof CacheJail) {
$this->unjailedRoot = $parent->getSourcePath($this->unjailedRoot);
}
$parent = $parent->getCache();
} }
} }