From patchwork Sat May 25 01:45:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2262 Return-Path: Received: from mail01.ipfire.org (mail01.i.ipfire.org [172.28.1.200]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail01.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web07.i.ipfire.org (Postfix) with ESMTPS id D08FC89FA6B for ; Fri, 24 May 2019 16:46:45 +0100 (BST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 459W2D52fcz51tbw; Fri, 24 May 2019 16:46:44 +0100 (BST) Received: from tuxedo.stevee (213162073099.public.t-mobile.at [213.162.73.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 459W295LpVz51tbh; Fri, 24 May 2019 16:46:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904rsa; t=1558712802; 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=cN4koshdOiviXvd3LgzGxTKET6BL0/WeOw5Yhwjy4OE=; b=N1KpYbRdKncSqSVv8i3+fyDB+KT6q5FU8dQO5N9M73uPyDbegvjivNniY7wTmruyysr7GK vJO4Ybvqb3hw30cZQPKljmW/LmX0R4nCGXnEjAe4oOC0vug3qt22e2igTLRNIw4i3elODq mvarSkJ5b4G36LkoH6h4bNhyqXwc92pC7hkj+D4llB2AeDGpKArH/yIKMp0ktGCSz3Y7DP d5k4hPJcU6130dWiVhGtKtvf/LYpSWHmcSRhKfe3iOrNfdwtG9TNCOTDMZAnPFulMGIaHh A92hBnoxJ8tvCW7BBTbTTZHk6WwEMx/7+hpGYPX4CVIi12gm3Ge3ZP0YTCen4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904ed25519; t=1558712802; 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=cN4koshdOiviXvd3LgzGxTKET6BL0/WeOw5Yhwjy4OE=; b=tCznVTkC/X83CyMgXGKYxp7EAnZS1BYCC9lwHFS7RisKIpiaVRVsjPAD15UjQ9NRB0DgFJ LJehalB9aNdWw9AA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] ids-functions.pl: Do not delete the whitelist file on rulesdir cleanup. Date: Fri, 24 May 2019 17:45:33 +0200 Message-Id: <20190524154533.4697-1-stefan.schantl@ipfire.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=stevee smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 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" Fixes #12087. 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 deb287bb7..a52440f35 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -582,6 +582,9 @@ sub _cleanup_rulesdir() { # Skip element if it has config as file extension. next if ($file =~ m/\.config$/); + # Skip rules file for whitelisted hosts. + next if ("$rulespath/$file" eq $whitelist_file); + # Delete the current processed file, if not, exit this function # and return an error message. unlink("$rulespath/$file") or return "Could not delete $rulespath/$file. $!\n";