Skip to content

Commit

Permalink
Do not prevent moving File if it's a big file chunking file
Browse files Browse the repository at this point in the history
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
  • Loading branch information
georgehrke committed Apr 23, 2020
1 parent a61323e commit 06070e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Connector/Sabre/LockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use OCA\DAV\Connector\Sabre\Exception\FileLocked;
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
use OCA\DAV\Connector\Sabre\File;
use OCA\DAV\Upload\FutureFile;
use OCA\EndToEndEncryption\LockManager;
use OCA\EndToEndEncryption\UserAgentManager;
use OCP\Files\FileInfo;
Expand Down Expand Up @@ -125,8 +126,9 @@ public function checkLock(RequestInterface $request): void {
if (!$this->isE2EEnabledPath($node->getPath()) && !$this->isE2EEnabledPath($destNode->getPath())) {
return;
}
// Prevent moving or copying stuff from non-encrypted to encrypted folders
if ($this->isE2EEnabledPath($node->getPath()) xor $this->isE2EEnabledPath($destNode->getPath())) {
// Prevent moving or copying stuff from non-encrypted to encrypted folders (only exception is big file chunking)
if (!($destNode instanceof FutureFile) &&
$this->isE2EEnabledPath($node->getPath()) xor $this->isE2EEnabledPath($destNode->getPath())) {
throw new Forbidden('Cannot copy or move files from non-encrypted folders to end to end encrypted folders or vice versa.');
}
} elseif (!$this->isE2EEnabledPath($node->getPath())) {
Expand Down

0 comments on commit 06070e0

Please sign in to comment.