From patchwork Wed Mar 23 04:04:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5390 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 4KNZWR5NCnz3xq8 for ; Wed, 23 Mar 2022 04:05:07 +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 4KNZWM3D1Dz5S7; Wed, 23 Mar 2022 04:05:03 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4KNZWL3vfVz2yyR; Wed, 23 Mar 2022 04:05:02 +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 4KNZWJ6hBFz2xqt for ; Wed, 23 Mar 2022 04:05:00 +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 4KNZWJ3WGRz1hX; Wed, 23 Mar 2022 04:05:00 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1648008300; 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=b6F2pRF4sa0NryX+GsMTKlqRC9rS7DM8OXGvk0TtzNY1HhtcNA/sV5senJugNUscU5v8N5 mBzv3tM68GJCYuBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1648008300; 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=FiS2wiPIxh8iV1A/963BVAltf74a6JAT7TGOlJ6LPikYLlUFM8zaFylmWYgZ2OAz68dmJ9 3zonGNjugsjWpCOQnJwhM5fBjULpaHL30/B+2O+6dvp3dy6GVMPb2T4RnBoc3F6ShhXNlT eL26m8iAbsQH8tSpBzfqcAzEdJ53vTr5sPG/IR5e5qJKc9zpw405XjemvYG8rpx3rj/Qxe 200CVxQlf0azR2e4P2IFfzAwKsOTL28h2/MVY7WyByOc3jsISo3KAykzhJkhhjVi3rcJVT Zbqz3m+n7Iv8fLUyPuoOdHSDDVS5QU5WY+kS25kytbXIj54w9qc50wMwsMhN6w== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 3/5] ids-functions.pl: Remove temporary file, if the download failed. Date: Wed, 23 Mar 2022 05:04:50 +0100 Message-Id: <20220323040452.2609-3-stefan.schantl@ipfire.org> In-Reply-To: <20220323040452.2609-1-stefan.schantl@ipfire.org> References: <20220323040452.2609-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++; }