From patchwork Mon Oct 5 18:36:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 10309 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 (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR2" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4hz7Q35z2Cz3wp9 for ; Mon, 05 Oct 2026 18:36:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "YE1" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4hz7Q23SPGz81h for ; Mon, 05 Oct 2026 18:36:26 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4hz7Q211spz33g7 for ; Mon, 05 Oct 2026 18:36:26 +0000 (UTC) X-Original-To: development@lists.ipfire.org 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 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR2" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4hz7Pz33TFz2xLw for ; Mon, 05 Oct 2026 18:36:23 +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 4hz7Px5kzqz1Cb; Mon, 05 Oct 2026 18:36:21 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1791225382; 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; bh=zuQGBaGq2Hgv+WeprkvQrmFLrMHep3pXoDel1gncnjE=; b=FwaU0p0fLFrGY7DEmSFfL22xVHcCRl0yqtpQZs0M291oIZAS45Kc+ehavBhDFT+H2zPGAo DZDynEEnDBgVBBCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1791225382; 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; bh=zuQGBaGq2Hgv+WeprkvQrmFLrMHep3pXoDel1gncnjE=; b=kNRVphz6S8RR9NPUsWfp6URWKmt1LZNh6Dv9RKgwwscKKnzRI/9lfozvqzY42ChUiS5Mc7 kpIoRDhJQHCqE362vFgB2ImudTX8t9J8luU/cAU1pd90jyu8UUBoNVxQYAW9LRhEubmdBB 5bcrAP378iOFHXDrSRvCqcHQnLz+dzcXg0/2i2RqaOYYBqJJqOy+zIj9KTkpyGLhvua1Fk U3a5s5vvQ6OWtkPL7c/hbyOTqLLdQsavddOMyyohbtl/yaMEXP7IGOUtlQRV6r7+N/dcBn BRTW6maphlcS/buZbe3sJQl64GYum9MEi1ABEEyxMWbj9rBIeKzxL+6VttuQug== From: Stefan Schantl To: development@lists.ipfire.org Cc: Stefan Schantl Subject: [PATCH] ids-functions.pl: Rework cleanup rulesdir logic Date: Mon, 5 Oct 2026 20:36:17 +0200 Message-ID: <20261005183617.4431-1-stefan.schantl@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Never drop any of the statically included rulefiles instead of specify them one by one. Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 93d1acdee..4c03926d7 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -1086,11 +1086,8 @@ sub _cleanup_rulesdir() { # We only want files. next unless (-f "$rulespath/$file"); - # Skip rules file for whitelisted hosts. - next if ("$rulespath/$file" eq $whitelist_file); - - # Skip rules file with local rules. - next if ("$rulespath/$file" eq $local_rules_file); + # Skip any files which are part of the array of statically included rulefiles. + next if (grep(/$file/, @static_included_rulefiles)); # Delete the current processed file, if not, exit this function # and return an error message.