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

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2025-05-12 18:33:26 +02:00
parent e5aabded60
commit 195358eb8e
2 changed files with 8 additions and 5 deletions

View file

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

View file

@ -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();
}
}