Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTigran Mkrtchyan <tigran.mkrtchyan@desy.de>2022-03-07 12:15:53 +0300
committerTigran Mkrtchyan <tigran.mkrtchyan@desy.de>2022-09-16 11:57:17 +0300
commit8fc4cf67f1553d0d37bb061925867789b27579fe (patch)
tree3feae6ed09a127727e45989a19c48e3f2a796bc8
parentb6065a236fe470e37b28e768d9e09b25e92b470d (diff)
files: remove destination file before copying new content (WORM)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
-rw-r--r--lib/private/Files/Storage/Local.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index 7af512ca3f6..b9dcb7d0537 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -372,6 +372,8 @@ class Local extends \OC\Files\Storage\Common {
return parent::copy($path1, $path2);
} else {
$oldMask = umask($this->defUMask);
+ // support Write-Once-Read-Many filesystems
+ $this->unlink($path2);
$result = copy($this->getSourcePath($path1), $this->getSourcePath($path2));
umask($oldMask);
return $result;