From 3a94648515835dcb74d5fda49c57d0dd2753087d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 15 Jun 2021 14:20:49 +0200 Subject: [PATCH 1/1] tools: download_file_from_url: handle interrupts Signed-off-by: Thomas Lamprecht --- src/PVE/Tools.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index a5efd60..567f604 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -1865,6 +1865,11 @@ sub download_file_from_url { } } + local $SIG{INT} = sub { + unlink $tmpdest or warn "could not cleanup temporary file: $!"; + die "got interrupted by signal\n"; + }; + { # limit the scope of the ENV change local %ENV; if ($opts->{http_proxy}) { -- 2.39.2