]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup temporary files after finishing the write to object storage 32711/head
authorJulius Härtl <jus@bitgrid.net>
Mon, 30 May 2022 15:53:07 +0000 (17:53 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Thu, 2 Jun 2022 16:31:26 +0000 (16:31 +0000)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Files/ObjectStore/ObjectStoreStorage.php

index adb3928b28ab4c1e1b49d1bfd5a913ccbb7987fb..898f64d97c2569a864d98506d0b63eb7df1a872e 100644 (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;