Compare commits

...

2 Commits

Author SHA1 Message Date
Robin Appelman 6a2f593a56 debug: add more logging around null paths with jails
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-11-24 17:06:19 +01:00
Robin Appelman 68091bbce3 debug: throw a proper error when directory content has a null path
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-11-24 16:40:35 +01:00
3 changed files with 10 additions and 1 deletions
@@ -92,7 +92,11 @@ class CacheJail extends CacheWrapper {
protected function formatCacheEntry($entry) {
if (isset($entry['path'])) {
$entry['path'] = $this->getJailedPath($entry['path']);
$sourcePath = $entry['path'];
$entry['path'] = $this->getJailedPath($sourcePath);
if (is_null($entry['path'])) {
$this->logger->error("'$sourcePath' is not inside jail path {$this->root}", ['entry' => $entry]);
}
}
return $entry;
}
@@ -27,6 +27,7 @@ class CacheWrapper extends Cache {
$this->mimetypeLoader = $cache->mimetypeLoader;
$this->connection = $cache->connection;
$this->querySearchHelper = $cache->querySearchHelper;
$this->logger = $cache->logger;
} else {
if (!$dependencies) {
$dependencies = Server::get(CacheDependencies::class);
@@ -34,6 +35,7 @@ class CacheWrapper extends Cache {
$this->mimetypeLoader = $dependencies->getMimeTypeLoader();
$this->connection = $dependencies->getConnection();
$this->querySearchHelper = $dependencies->getQuerySearchHelper();
$this->logger = $dependencies->getLogger();
}
}
+3
View File
@@ -1527,6 +1527,9 @@ class View {
if ($sharingDisabled) {
$content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
}
if (is_null($content['path'])) {
throw new \Exception('Directory listing of "' . $path . '" contains item with null path (' . $content['fileid'] . ')');
}
$ownerId = $storage->getOwner($content['path']);
if ($ownerId !== false) {
$owner = $this->getUserObjectForOwner($ownerId);