Merge pull request #32711 from nextcloud/backport/32662/stable23

[stable23] Cleanup temporary files after finishing the write to object storage
This commit is contained in:
Vincent Petry 2022-06-10 11:09:46 +02:00 committed by GitHub
commit 798aad883e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -335,6 +335,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$handle = fopen($tmpFile, $mode);
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
$this->writeBack($tmpFile, $path);
unlink($tmpFile);
});
case 'a':
case 'ab':
@ -352,6 +353,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$handle = fopen($tmpFile, $mode);
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
$this->writeBack($tmpFile, $path);
unlink($tmpFile);
});
}
return false;