[pve-devel] [PATCH storage 2/4] api: storage status: do not pull OCI image if file already exists

Filip Schauer f.schauer at proxmox.com
Mon Nov 17 18:13:15 CET 2025


This ensures that the API call fails early, before pulling the OCI image
from the registry and then failing to rename the temporary file.

Signed-off-by: Filip Schauer <f.schauer at proxmox.com>
---
 src/PVE/API2/Storage/Status.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/API2/Storage/Status.pm b/src/PVE/API2/Storage/Status.pm
index 96832b9..9fb6141 100644
--- a/src/PVE/API2/Storage/Status.pm
+++ b/src/PVE/API2/Storage/Status.pm
@@ -964,6 +964,8 @@ __PACKAGE__->register_method({
         my $path = PVE::Storage::get_vztmpl_dir($cfg, $storage);
         PVE::Storage::activate_storage($cfg, $storage);
 
+        die "refusing to override existing file '$filename'\n" if (-f "$path/$filename");
+
         local $SIG{INT} = sub {
             unlink "$path/$tmp_filename"
                 or warn "could not cleanup temporary file: $!"
-- 
2.47.3





More information about the pve-devel mailing list