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 31, 2022
1 parent f08f00d commit 2777fe9
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 @@ -364,6 +364,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 2777fe9

Please sign in to comment.