Skip to content

Commit

Permalink
files: remove destination file before copying new content (WORM)
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Mar 7, 2022
1 parent 44e2a7d commit 5e6ac2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/private/Files/Storage/Local.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ public function copy($path1, $path2) {
return parent::copy($path1, $path2);
} else {
$oldMask = umask(022);
// support Write-Once-Read-Many filesystems
$this->unlink($path2);
$result = copy($this->getSourcePath($path1), $this->getSourcePath($path2));
umask($oldMask);
return $result;
Expand Down

0 comments on commit 5e6ac2b

Please sign in to comment.