From patchwork Tue Mar 22 19:40:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5387 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4KNML22RDDz3xlr for ; Tue, 22 Mar 2022 19:41:14 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4KNMKy1CdTz5Qs; Tue, 22 Mar 2022 19:41:10 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4KNMKx3clCz2yxL; Tue, 22 Mar 2022 19:41:09 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4KNMKv2Ndnz2xXd for ; Tue, 22 Mar 2022 19:41:07 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4KNMKv0883z1Lp; Tue, 22 Mar 2022 19:41:06 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1647978067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FNklpXOAyXg6LctDs9JNxASxGsaRrgKxAitoWULYZhY=; b=pZh9kOivKZxdnsm/iO8AsVs/ZnAHankiUv2ZfLM/CSzIxTsn3qeuDwXNop8JQfIQPCZvW3 fydOM/ONguVeagDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1647978067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FNklpXOAyXg6LctDs9JNxASxGsaRrgKxAitoWULYZhY=; b=M1sMwtA8lJ1posEIecMb4CYy8d+yiyZFsoHl1zKup6gm+DtzizMylIwaLI4oOFj90PO39u qn237vq8mLF+HW5gpZiwrwf5iOtcqDnIc7VfUtuBvDmkr1vd7RcYOHRkAKqRR3iZoDX7Pn R9rByFqCA2GKS0VbcMtzNfLS6ggiTh+ngZVQGVQTWP6LNZ3/xpzLiWezhS2dwBdMFvh8CU K34OohTW7XUm5pwBPKL/dNuflvTwGpb0CRAtHRVkzar6Q0pK0RuMdjW7P9sos3vL9D6KVI nIv8enN1T5gF4VExJrLUc49cJpLeSCDE7MQ7MX0EtaazOsELgsbbAKCFLPpdBg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 3/5] ids-functions.pl: Remove temporary file, if the download failed. Date: Tue, 22 Mar 2022 20:40:57 +0100 Message-Id: <20220322194059.3030-3-stefan.schantl@ipfire.org> In-Reply-To: <20220322194059.3030-1-stefan.schantl@ipfire.org> References: <20220322194059.3030-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index c8bc52b1b..dfbeb1a7d 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -393,6 +393,9 @@ sub downloadruleset ($) { return 1; } + # Remove temporary file, if one exists. + unlink("$tmpfile") if (-e "$tmpfile"); + # Increase download attempt counter. $dl_attempt++; }