aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-05-10 07:56:18 +0200
committerGitHub <noreply@github.com>2023-05-10 07:56:18 +0200
commit9e039663c06c17a25bbf70e9a0247dcd88a4a53c (patch)
treee84ed2ae43b59cc452476b4e838b5d26f90b42fb /lib/private
parent41213d052c2c9323239e345cde0fd12976390978 (diff)
parent2e09f075ee61d3eca3c1e836cba6f6d5130f7aa9 (diff)
downloadnextcloud-server-9e039663c06c17a25bbf70e9a0247dcd88a4a53c.tar.gz
nextcloud-server-9e039663c06c17a25bbf70e9a0247dcd88a4a53c.zip
Merge pull request #38129 from nextcloud/backport/36774/stable25
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/Node/Node.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index bfa4d6861ea..161b3e2dd30 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -37,6 +37,7 @@ use OCP\Files\InvalidPathException;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Lock\LockedException;
+use OCP\PreConditionNotMetException;
use Symfony\Component\EventDispatcher\GenericEvent;
// FIXME: this class really should be abstract
@@ -52,7 +53,7 @@ class Node implements \OCP\Files\Node {
protected $root;
/**
- * @var string $path
+ * @var string $path Absolute path to the node (e.g. /admin/files/folder/file)
*/
protected $path;
@@ -73,6 +74,9 @@ class Node implements \OCP\Files\Node {
* @param FileInfo $fileInfo
*/
public function __construct($root, $view, $path, $fileInfo = null, ?Node $parent = null) {
+ if (Filesystem::normalizePath($view->getRoot()) !== '/') {
+ throw new PreConditionNotMetException('The view passed to the node should not have any fake root set');
+ }
$this->view = $view;
$this->root = $root;
$this->path = $path;