From 8fc4cf67f1553d0d37bb061925867789b27579fe Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Mon, 7 Mar 2022 10:15:53 +0100 Subject: files: remove destination file before copying new content (WORM) Signed-off-by: Tigran Mkrtchyan --- lib/private/Files/Storage/Local.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/private/Files/Storage/Local.php') 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; -- cgit v1.2.3