From patchwork Fri Dec 22 12:37:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7408 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) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4SxRfM6Q4Cz3x1w for ; Fri, 22 Dec 2023 12:38:03 +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 (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4SxRfH6tMpzCJ; Fri, 22 Dec 2023 12:37:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4SxRfH37Qfz32Vs; Fri, 22 Dec 2023 12:37:59 +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 (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4SxRfF40qbz2xGh for ; Fri, 22 Dec 2023 12:37:57 +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 (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4SxRfC4MLPzCJ; Fri, 22 Dec 2023 12:37:55 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1703248675; 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=f+3+zE3dSUhXvvtzFrObVPe29R/OHZwoz03/GSZ0k5I=; b=kX4aEue34Jh9koGByKEzThgTP8yOIdtkwrfRR6kyOcr3iX1Mk8z4XSyEjOWaoURhSDcR7D OtBnJXuweqYNJLAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1703248675; 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=f+3+zE3dSUhXvvtzFrObVPe29R/OHZwoz03/GSZ0k5I=; b=EjT6WiuUqZ3SUSt6g4PVTviS5zSyqFljOqgNAiU0x1oPkVYqoMOY1PpoOhKMJdKJO6hVIb gZWZpygkxNFe/toh5/PRGgY6i9LMpEPQ6wW+8d/zMxdqEUGuIKlBwLj9x/QTW3UMNOU8Mr zlLVH/OOybyeLuVMqI9VcyVjoEhBiiVMa3Cr0VOoTAxq7qL0gj8g0MkS0IRM/VsKQknHnj TNHPIyq+SpzvCdIjXHES/JLz9H1ng6YNhZocvY0f5s74SLZ/Au8yT5kNw/GLNGvjiPvMFZ ns5CygX6JudB6m5RY5wtHcpRWr2pPOun7moB6ZHsSpQ9UjbuwbecnxLfQF0asQ== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] firewalllog.dat: Fix for bug#13492 - include chain in the exported output Date: Fri, 22 Dec 2023 13:37:47 +0100 Message-ID: <20231222123747.5917-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: PG3GJUZAQDXWS543AB65D6237BSCTQES X-Message-ID-Hash: PG3GJUZAQDXWS543AB65D6237BSCTQES X-MailFrom: adolf.belka@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: - The regex code does not extract out the chain and so it is missed off from the log output when it is exported. - Changed code tested out on my vm testbed and confirmed to work and include the chain in the output. Fixes: Bug13492 Tested-by: Adolf Belka Signed-off-by: Adolf Belka Reviewed-by: Bernhard Bitsch --- html/cgi-bin/logs.cgi/firewalllog.dat | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/logs.cgi/firewalllog.dat b/html/cgi-bin/logs.cgi/firewalllog.dat index 467d06008..b07a4262d 100644 --- a/html/cgi-bin/logs.cgi/firewalllog.dat +++ b/html/cgi-bin/logs.cgi/firewalllog.dat @@ -211,11 +211,12 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}) foreach $_ (@log) { - /^... (..) (..:..:..) [\w\-]+ kernel:.*(IN=.*)$/; + /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/; my $day = $1; $day =~ tr / /0/; my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ; - print "$time $3\r\n"; + my $chain = $3; + print "$time $chain $4\r\n"; } exit 0;