diff options
author | Tigran Mkrtchyan <tigran.mkrtchyan@desy.de> | 2022-03-07 10:15:53 +0100 |
---|---|---|
committer | Tigran Mkrtchyan <tigran.mkrtchyan@desy.de> | 2022-09-16 10:57:17 +0200 |
commit | 8fc4cf67f1553d0d37bb061925867789b27579fe (patch) | |
tree | 3feae6ed09a127727e45989a19c48e3f2a796bc8 /lib | |
parent | b6065a236fe470e37b28e768d9e09b25e92b470d (diff) | |
download | nextcloud-server-8fc4cf67f1553d0d37bb061925867789b27579fe.tar.gz nextcloud-server-8fc4cf67f1553d0d37bb061925867789b27579fe.zip |
files: remove destination file before copying new content (WORM)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Local.php | 2 |
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; |