From patchwork Mon Apr 6 12:34:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2912 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48wqjf2c1Pz3wdp for ; Mon, 6 Apr 2020 12:34:30 +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 "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48wqjc4w17z2MJ; Mon, 6 Apr 2020 12:34:28 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48wqjc1JpPz2y5S; Mon, 6 Apr 2020 12:34:28 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48wqjZ5Z1vz2xhb for ; Mon, 6 Apr 2020 12:34:26 +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) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48wqjY082bzvL; Mon, 6 Apr 2020 12:34:24 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586176465; 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=9yG4kiDef2sSbDi9sjIZ4aAAC9yIq8qoqk7dOaw1KBc=; b=pbTCTuWpRK7jNgYmQmJ8Y5LotaY1VNwket90GaE1z0VlgUpbVLf3R9GzXyeHUh1hNfCIT1 WfGiGJNktYCZ7cBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586176465; 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=9yG4kiDef2sSbDi9sjIZ4aAAC9yIq8qoqk7dOaw1KBc=; b=CnhN0v2HAS8UE/k4t7tTy69D7nwQalLP9i4amhEcXZfvayg8S/kYcCWAF6ZEuesS6bpJcc kNcHxcfhm0HSeblNRR5N15O0GRcuIi+aZ50hPIpdof5Q0+q8j1m4qcoq9xmU8zU+t9RWL5 iKLhROoULlRASybqNiFRy/TDlciITp3fpNpB5MPK7f6i17qXnRYQSZzf3zgFRYsV3lwJEe dHt2qGXYbIC/pkROqxp7h5Z3ZFUkOPd91q7kJAhhdUZ7EdxrT7ClZ3ZYtSJ6d+kr6SWY0C kKcBJqwaJS9csYpaxsePP5qpfgAfDMRkVsLi66Cs5FNcxDbTeKDTwJtR70KMKQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] ids.cgi: Fix logic if suricata needs to be restarted. Date: Mon, 6 Apr 2020 14:34:21 +0200 Message-Id: <20200406123421.3162-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org 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 --- html/cgi-bin/ids.cgi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index df7138e08..bc31a341f 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -417,17 +417,17 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) { # Loop through the hash of idsrules. foreach my $rulefile(keys %idsrules) { + # Check if the state of the rulefile has been changed. + unless ($cgiparams{$rulefile} eq $idsrules{$rulefile}{'Rulefile'}{'State'}) { + # A restart of suricata is required to apply the changes of the used rulefiles. + $suricata_restart_required = 1; + } + # Check if the rulefile is enabled. if ($cgiparams{$rulefile} eq "on") { # Add rulefile to the array of enabled rulefiles. push(@enabled_rulefiles, $rulefile); - # Check if the state of the rulefile has been changed. - unless ($cgiparams{$rulefile} eq $idsrules{$rulefile}{'Rulefile'}{'State'}) { - # A restart of suricata is required to apply the changes of the used rulefiles. - $suricata_restart_required = 1; - } - # Drop item from cgiparams hash. delete $cgiparams{$rulefile}; }