summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorMax <max@nextcloud.com>2023-08-02 10:09:13 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-08-02 11:58:09 +0000
commit4f2a538b7ad04bc96893d4ff5be25d2308916fd0 (patch)
tree7ad5df2a9a9c8d54058a89e728df55a997709060 /apps/dav
parente33ac4e6a83365e29da0927a7f957f58a6146a1f (diff)
downloadnextcloud-server-4f2a538b7ad04bc96893d4ff5be25d2308916fd0.tar.gz
nextcloud-server-4f2a538b7ad04bc96893d4ff5be25d2308916fd0.zip
fix(dav): use quota of destination in s3 chunk upload
Resolves: #39228. Check the free space on the destination. Before it was checking the free space on `$storage` which is the upload storage of the user who triggered the upload. This led to user quota being applied even when uploading to a share with unlimited space. Signed-off-by: Max <max@nextcloud.com>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Upload/ChunkingV2Plugin.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/dav/lib/Upload/ChunkingV2Plugin.php b/apps/dav/lib/Upload/ChunkingV2Plugin.php
index d3673c6bde7..97ae51fbe38 100644
--- a/apps/dav/lib/Upload/ChunkingV2Plugin.php
+++ b/apps/dav/lib/Upload/ChunkingV2Plugin.php
@@ -168,7 +168,7 @@ class ChunkingV2Plugin extends ServerPlugin {
[$destinationDir, $destinationName] = Uri\split($this->uploadPath);
/** @var Directory $destinationParent */
$destinationParent = $this->server->tree->getNodeForPath($destinationDir);
- $free = $storage->free_space($destinationParent->getInternalPath());
+ $free = $destinationParent->getNode()->getFreeSpace();
$newSize = $tempTargetFile->getSize() + $additionalSize;
if ($free >= 0 && ($tempTargetFile->getSize() > $free || $newSize > $free)) {
throw new InsufficientStorage("Insufficient space in $this->uploadPath");
@@ -225,7 +225,7 @@ class ChunkingV2Plugin extends ServerPlugin {
foreach ($parts as $part) {
$size += $part['Size'];
}
- $free = $storage->free_space($destinationParent->getInternalPath());
+ $free = $destinationParent->getNode()->getFreeSpace();
if ($free >= 0 && ($size > $free)) {
throw new InsufficientStorage("Insufficient space in $this->uploadPath");
}