From patchwork Tue Mar 22 19:40:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5388 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 4KNML66Mstz3xlr for ; Tue, 22 Mar 2022 19:41:18 +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 4KNMKy71RYz5Vj; Tue, 22 Mar 2022 19:41:10 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4KNMKx4n0Xz2yyV; Tue, 22 Mar 2022 19:41:09 +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 4KNMKw0qXqz2xWt for ; Tue, 22 Mar 2022 19:41:08 +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 4KNMKv5y7Bz1Lp; Tue, 22 Mar 2022 19:41:07 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1647978068; 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=kY63ojOVGRfh+iW7CfHQt9NMGzG6f3GZStpDxEaisgg=; b=XtiEfxEMpr9hoYPXA8fMyxpFuHzk5M3pKLvkPfZNPJ+zwAXTBiSbNwxu/jtgHrcpbOnnPk ZKmIoPDczg7vtrCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1647978068; 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=kY63ojOVGRfh+iW7CfHQt9NMGzG6f3GZStpDxEaisgg=; b=q/TZ/cepYzEk5laP96YiDaZZnwlMeFYZcjpYow520/94OXhZx/xKoaGfzIi9ejXcwHEFw7 kmj3rKznMRj4VT5SRTPsZ3Ck7NeTwxCOlRXirSMFIn1Oz3bxYxCKL4oIQ8WtXu1EoEAfai PF6iL8OWt9RyiskapOfbZEWLClpwpMllwDmlDv5xpPS9B0TZHdCWBgijuUmQIjJKkwlK+O HWHlmg/8bKzJLro3Agsjrj3E5MqcElj3f0WFV5lj1VFmWbAg+dNAw2Ncqc4/X5SGNRdo7a gauwiquAx9UVPcUkmomchOr7Bf/c8ceqwK7aSVtQ36u+07o2SCBG+/iKAxnU9w== 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: Tue, 22 Mar 2022 20:40:59 +0100 Message-Id: <20220322194059.3030-5-stefan.schantl@ipfire.org> In-Reply-To: <20220322194059.3030-1-stefan.schantl@ipfire.org> References: <20220322194059.3030-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" 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');