From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4ZjynG4Chbz337h for ; Thu, 24 Apr 2025 14:20:50 +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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4ZjynC0DWQz3332 for ; Thu, 24 Apr 2025 14:20:47 +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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZjynB5vDqz19H; Thu, 24 Apr 2025 14:20:46 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1745504446; 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=gweZrkToANpjOB+0FlPz0fINR2WUkzZ9zuHf65xBQk0=; b=+xSg+riVRApaAwYG0TiljhHsbQMicL4fyDx8wTJZgAfSt1ajyPJ+9WgPyfcysJVjFQiwmT br7MJ2Gbw4yVuPAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1745504446; 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=gweZrkToANpjOB+0FlPz0fINR2WUkzZ9zuHf65xBQk0=; b=NfXVDudQrE7oNuXnkKr550+EnU7cMLg4cGlZRjLI+995CDuP8BBfsr+kbj8ftAbXiRbGkP YYlM1FoM8Vab0+F/Qhvg7oVa7Gx6qWC2fDqLjupSCD2jNZrxeONBfhBsX+30i/M5PliSgF yvgIHSpId3nHpsfPZSkdH00V+QfIF45GH2T+cDzAW4M8Wdv84118aTV9+lZ1p7LLs2mpUl mLNlSpkfHXdzJCyr/TQpqci8a/6rDOMKDGQMzWAyk7owrcvl9ILweCQMVH7SwSlHifC6qy zQ+Gg8j0uIZMGsABe3V7wDGfhecrbj7OD4dqwJr7PDO5iPIjQyXiFJVVtGiiWA== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH 2/4] backup.pl: Remove any 3coresec ipblocklists from old backups being restored Date: Thu, 24 Apr 2025 16:20:39 +0200 Message-ID: <20250424142041.3443255-2-adolf.belka@ipfire.org> In-Reply-To: <20250424142041.3443255-1-adolf.belka@ipfire.org> References: <20250424142041.3443255-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit - This patch ensures that any restore from an old backup cointaining the 3coresec lists will not restore the ipblocklist associated files for those lists. Signed-off-by: Adolf Belka --- config/backup/backup.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index 0cfbd4fc3..b36296ee8 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -252,11 +252,14 @@ restore_backup() { -out /etc/httpd/server.crt &>/dev/null fi - # Remove any entry for ALIENVAULT, SPAMHAUS_EDROP or ABUSECH_BOTNETC2 from the ipblocklist modified file + # Remove any entry for ALIENVAULT, SPAMHAUS_EDROP, ABUSECH_BOTNETC2 or 3CORESEC from the ipblocklist modified file # and the associated ipblocklist files from the /var/lib/ipblocklist directory sed -i '/ALIENVAULT=/d' /var/ipfire/ipblocklist/modified sed -i '/SPAMHAUS_EDROP=/d' /var/ipfire/ipblocklist/modified sed -i '/ABUSECH_BOTNETC2=/d' /var/ipfire/ipblocklist/modified + sed -i '/3CORESEC_SSH=/d' /var/ipfire/ipblocklist/modified + sed -i '/3CORESEC_SCAN=/d' /var/ipfire/ipblocklist/modified + sed -i '/3CORESEC_WEB=/d' /var/ipfire/ipblocklist/modified if [ -e /var/lib/ipblocklist/ALIENVAULT.conf ]; then rm /var/lib/ipblocklist/ALIENVAULT.conf fi @@ -266,6 +269,15 @@ restore_backup() { if [ -e /var/lib/ipblocklist/ABUSECH_BOTNETC2.conf ]; then rm /var/lib/ipblocklist/ABUSECH_BOTNETC2.conf fi + if [ -e /var/lib/ipblocklist/3CORESEC_SSH.conf ]; then + rm /var/lib/ipblocklist/3CORESEC_SSH.conf + fi + if [ -e /var/lib/ipblocklist/3CORESEC_SCAN.conf ]; then + rm /var/lib/ipblocklist/3CORESEC_SCAN.conf + fi + if [ -e /var/lib/ipblocklist/3CORESEC_WEB.conf ]; then + rm /var/lib/ipblocklist/3CORESEC_WEB.conf + fi # The collectd directory structure was changed but not all changes # are done by the official migration script generator -- 2.49.0