aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-09-15 22:17:41 +0200
committerGitHub <noreply@github.com>2024-09-15 22:17:41 +0200
commit038eff0b60eb4bac73519f99ec01d71f90a3b400 (patch)
tree3727d3b1e275b8a2f080145c7b55689a8b019218 /lib
parent74597ecbb17a97a9b7372d6bced5041b6a17d010 (diff)
parent01596b54c039a7f1b57fe4198f9c18a73aa8a6da (diff)
downloadnextcloud-server-038eff0b60eb4bac73519f99ec01d71f90a3b400.tar.gz
nextcloud-server-038eff0b60eb4bac73519f99ec01d71f90a3b400.zip
Merge pull request #47795 from nextcloud/backport/47756/stable29
[stable29] fix(files): Check if target path is a descendant of the shared folder
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/View.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index efe3bcf5abc..b6b136ab178 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1829,7 +1829,8 @@ class View {
}, $providers));
foreach ($shares as $share) {
- if (str_starts_with($targetPath, $share->getNode()->getPath())) {
+ $sharedPath = $share->getNode()->getPath();
+ if ($targetPath === $sharedPath || str_starts_with($targetPath, $sharedPath . '/')) {
$this->logger->debug(
'It is not allowed to move one mount point into a shared folder',
['app' => 'files']);