Skip to content

Commit 202f9d5

Browse files
committed
debug: add more logging around null paths with jails
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 480bd4c commit 202f9d5

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

lib/private/Files/Cache/Wrapper/CacheJail.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ protected function getJailedPath(string $path, ?string $root = null) {
102102
#[\Override]
103103
protected function formatCacheEntry($entry) {
104104
if (isset($entry['path'])) {
105-
$entry['path'] = $this->getJailedPath($entry['path']);
105+
$sourcePath = $entry['path'];
106+
$entry['path'] = $this->getJailedPath($sourcePath);
107+
if (is_null($entry['path'])) {
108+
$this->logger->error("'$sourcePath' is not inside jail path {$this->root}", ['entry' => $entry]);
109+
}
106110
}
107111
return $entry;
108112
}

lib/private/Files/Cache/Wrapper/CacheWrapper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ public function __construct(
2525
$this->mimetypeLoader = $this->cache->mimetypeLoader;
2626
$this->connection = $this->cache->connection;
2727
$this->querySearchHelper = $this->cache->querySearchHelper;
28+
$this->logger = $cache->logger;
2829
} else {
2930
if (!$dependencies) {
3031
$dependencies = Server::get(CacheDependencies::class);
3132
}
3233
$this->mimetypeLoader = $dependencies->getMimeTypeLoader();
3334
$this->connection = $dependencies->getConnection();
3435
$this->querySearchHelper = $dependencies->getQuerySearchHelper();
36+
$this->logger = $dependencies->getLogger();
3537
}
3638
}
3739

lib/private/Files/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ public function getDirectoryContent(string $directory, ?string $mimeTypeFilter =
15521552
$content['permissions'] = $content->getPermissions() & $permissionsMask;
15531553
}
15541554
if (is_null($content['path'])) {
1555-
throw new \Exception('Directory listing of "' . $path . '" contains item with null path');
1555+
throw new \Exception('Directory listing of "' . $path . '" contains item with null path (' . $content['fileid'] . ')');
15561556
}
15571557
$ownerId = $storage->getOwner($contentPath);
15581558
$owner = $ownerId !== false

0 commit comments

Comments
 (0)