From patchwork Wed Mar 23 04:04:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5393 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 4KNZWY2DLwz3wtb for ; Wed, 23 Mar 2022 04:05:13 +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 4KNZWN3Vggz5Vj; Wed, 23 Mar 2022 04:05:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4KNZWM5k3Wz2yyB; Wed, 23 Mar 2022 04:05:03 +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 4KNZWK58D0z2yxF for ; Wed, 23 Mar 2022 04:05:01 +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 4KNZWK2LQkzLX; Wed, 23 Mar 2022 04:05:01 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1648008301; 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=Lp8lyILpJuR/PhDq086jINK2FOinJPqIfslugJpdni8=; b=YRBJHr8qWoz4e1hgdJ1Xr2eSw7hplrp8V8Jd2vehMVMOLiLOUaw5PLbzWHLHWe+/gvUYBw d5wMhylzTtzLYoAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1648008301; 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=Lp8lyILpJuR/PhDq086jINK2FOinJPqIfslugJpdni8=; b=HBFuJEzv5ywL0G11ES4h748NTxcfbFzUYypevKckffbZBdLN/Y37tHfkWEwa7UaqYnnHXU SC3NJck4UVhpgdWK5fngUnwqEyH2NVQ2fP3hVnfqJ6CBFwBSE+7bGqZEQbnGZMFYnTkD5t WmfRvYNBmNMbDZRPY3llm7aSWH/2JG8p9W6VRzabEB6ogxZXeKPMMZoiso8it46QA8OE1y 6RSPcgfNJXKsEcGk21W+fqhMP89UVEch7LxpOLbfuplHBT334ylyJyd76e0vtWbZU7r6Co mcP8qNvYHVrxNGkZEs4jmC8Y/pJjvcZ83Ns9YD/BJwQhPjqMHIP2v/j93vBdTQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 5/5] ids-functions.pl: Do not longer call any log message as "ERROR". Date: Wed, 23 Mar 2022 05:04:52 +0100 Message-Id: <20220323040452.2609-5-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" Fixes #12805. Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index d7df41dd1..9eb375bc9 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -226,7 +226,7 @@ sub checkdiskspace () { # Check if the available disk space is more than 300MB. if ($available < 300) { # Log error to syslog. - &_log_to_syslog("Not enough free disk space on /var. Only $available MB from 300 MB available."); + &_log_to_syslog(" Not enough free disk space on /var. Only $available MB from 300 MB available."); # Exit function and return "1" - False. return 1; @@ -270,7 +270,7 @@ sub downloadruleset ($) { # Check if a ruleset has been configured. unless(%used_providers) { # Log that no ruleset has been configured and abort. - &_log_to_syslog("No ruleset provider has been configured."); + &_log_to_syslog(" No ruleset provider has been configured."); # Return "1". return 1; @@ -333,7 +333,7 @@ sub downloadruleset ($) { # Loop through the hash of sheduled providers. foreach my $provider ( keys %sheduled_providers) { # Log download/update of the ruleset. - &_log_to_syslog("Downloading ruleset for provider: $provider."); + &_log_to_syslog(" Downloading ruleset for provider: $provider."); # Grab the download url for the provider. my $url = $IDS::Ruleset::Providers{$provider}{'dl_url'}; @@ -354,7 +354,7 @@ sub downloadruleset ($) { # Abort if no url could be determined for the provider. unless ($url) { # Log error and abort. - &_log_to_syslog("Unable to gather a download URL for the selected ruleset provider."); + &_log_to_syslog(" Unable to gather a download URL for the selected ruleset provider."); return 1; } @@ -400,7 +400,7 @@ sub downloadruleset ($) { # Check if the server responds with 304 (Not Modified). } elsif ($response->code == 304) { # Log to syslog. - &_log_to_syslog("Ruleset is up-to-date, no update required."); + &_log_to_syslog(" Ruleset is up-to-date, no update required."); # Nothing to be done, the ruleset is up-to-date. return; @@ -411,7 +411,7 @@ sub downloadruleset ($) { my $error = $response->content; # Log error message. - &_log_to_syslog("Unable to download the ruleset. \($error\)"); + &_log_to_syslog(" Unable to download the ruleset. \($error\)"); # Return "1" - false. return 1; @@ -446,8 +446,8 @@ sub downloadruleset ($) { # Check if both file sizes match. if (($remote_filesize) && ($remote_filesize ne $local_filesize)) { # Log error message. - &_log_to_syslog("Unable to completely download the ruleset. "); - &_log_to_syslog("Only got $local_filesize Bytes instead of $remote_filesize Bytes. "); + &_log_to_syslog(" Unable to completely download the ruleset. "); + &_log_to_syslog(" Only got $local_filesize Bytes instead of $remote_filesize Bytes. "); # Delete temporary file. unlink("$tmpfile"); @@ -459,7 +459,7 @@ sub downloadruleset ($) { # Check if a file name could be obtained. unless ($dl_rulesfile) { # Log error message. - &_log_to_syslog("Unable to store the downloaded rules file. "); + &_log_to_syslog(" Unable to store the downloaded rules file. "); # Delete downloaded temporary file. unlink("$tmpfile"); @@ -518,7 +518,7 @@ sub extractruleset ($) { # Check if the file exists. unless (-f $tarball) { - &_log_to_syslog("Could not find ruleset file: $tarball"); + &_log_to_syslog(" Could not find ruleset file: $tarball"); # Return nothing. return; @@ -897,7 +897,7 @@ sub _log_to_syslog ($) { # The syslog function works best with an array based input, # so generate one before passing the message details to syslog. - my @syslog = ("ERR", " $message"); + my @syslog = ("ERR", "$message"); # Establish the connection to the syslog service. openlog('oinkmaster', 'cons,pid', 'user');