From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WNCdB2GCvWPOzQAAbAwnHQ (envelope-from ) for ; Tue, 10 Jan 2023 16:21:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oKRVBmGCvWMLPAEAG6o9tA (envelope-from ) for ; Tue, 10 Jan 2023 16:21:05 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7F13ABF0B for ; Tue, 10 Jan 2023 16:21:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFFw4-0006lK-A2; Tue, 10 Jan 2023 09:49:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFFvy-0006k5-S0 for guix-patches@gnu.org; Tue, 10 Jan 2023 09:49:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFFvy-0004VZ-H8 for guix-patches@gnu.org; Tue, 10 Jan 2023 09:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFFvy-0007fB-2v for guix-patches@gnu.org; Tue, 10 Jan 2023 09:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60707] [PATCH v2] gnu: services: Fix fail2ban configuration serialization. References: <20230110101136.26169-1-mail@muradm.net> In-Reply-To: <20230110101136.26169-1-mail@muradm.net> Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Jan 2023 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60707 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60707@debbugs.gnu.org Received: via spool by 60707-submit@debbugs.gnu.org id=B60707.167336208529321 (code B ref 60707); Tue, 10 Jan 2023 14:49:02 +0000 Received: (at 60707) by debbugs.gnu.org; 10 Jan 2023 14:48:05 +0000 Received: from localhost ([127.0.0.1]:39215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFFv2-0007cp-Q8 for submit@debbugs.gnu.org; Tue, 10 Jan 2023 09:48:05 -0500 Received: from nomad-cl1.staging.muradm.net ([139.162.159.157]:39868 helo=nomad-cl1.muradm.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFFv1-0007bg-1M for 60707@debbugs.gnu.org; Tue, 10 Jan 2023 09:48:03 -0500 Received: from localhost ([127.0.0.1]:58418) by nomad-cl1.muradm.net with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1pFFtO-00073Y-0n for 60707@debbugs.gnu.org; Tue, 10 Jan 2023 14:46:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=muradm.net; s=mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nkxUh1ocPUR6bdbp+m7KYY1gtHVGP1mqLyZ2gWpUOd0=; b=hS6RSk2lsTPhj968Kjw8Z1HV7R /H+s1ZjJPWQB8ZaUZ97Y/kLZsIhcz/1XvYNEwu3XL3cuLjVNZamdisZ13MjKCT1eo+N81Ny6WBzcW gAWQY8xD7f943zQbT27h7ASUhvboM+2Ri/FppxVeu6up5TusGCXSQGaBvKmHjX7Y9HjV1bzJgA9jw qY19HF204nBtDRQBTQywnSPL2lY21j+B5JBjh7Rn+51bUKzgy0v0KnXEmUPPGuf2+hK+Po2v24cU4 O1WfO1QwbDOrExNRc+1xRRjeFv7fqsKTBMD4T1uidmR+v8lt14i45xW90vlKbXP1eLFxd7NjyUwsf RTs+iP/lqQ+mTRMjne18iwi1Jl/8grDYeY+1YjnfJhLXZsByldlOMr9LnSqAlT6adMshRzwKZ4FZO Jk8Cz3EDCsBhI+SIy+LLFHle99KpCfTLbMPrSGMCJ6vo/klUjBEtRn8e+l6BpNSMN6l5RbT0fUfp+ 3zBq780uYgMWqxWVcJSiROUs; Received: from muradm by localhost with local (Exim 4.96) (envelope-from ) id 1pFFuu-00086u-1N for 60707@debbugs.gnu.org; Tue, 10 Jan 2023 17:47:56 +0300 From: muradm Date: Tue, 10 Jan 2023 17:47:56 +0300 Message-Id: <20230110144756.31172-1-mail@muradm.net> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673364064; a=rsa-sha256; cv=none; b=NWxiV3srMIOScjR8TEwCUFFlQGz4z+IjhmDZRZypetncJg0AQqnTcUEuP9OkPBzm7zd2Wy zDAkf7T3D1tUZBm2T2TLz7/GbWyHlNZcnBoYv0l4IyaooRRuer1WEp9pazuoWbsGg54pXd 9NvK7vLZ2th9ih79KhRR7YFHCxyC+ivwsfLJvQcNcq7FkgFjAXXYpBh+nD5wIqptkISmmK pZQUf9gq50OPwN/sn/bbba0oR3/q3TrbQBsdhMEfSbTaPlG/Lrnr9hxx2c/igYGV01D1d8 SDkrQ/KqjiSGU2dcdGHY1WNW64LJC/088l56nO7mE3XRY+HPK2SbfVie+FYLUQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=muradm.net header.s=mail header.b=hS6RSk2l; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673364064; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nkxUh1ocPUR6bdbp+m7KYY1gtHVGP1mqLyZ2gWpUOd0=; b=nzv7avweWsoJ+9KQ8bkXa6PXOrriG+uh+NL8pYU0Shn70P3ZGTvyDfwEAWnOxm13+l0/8g x0CF49EF4k9M4ENhWhi1n3evmuEXE5y5ZQmVYj5ROS5LLiVsLPLDhednD77HzFEkoKD+Ls RqJCl6WmZqiJNB2Enqe7wmuNRXCsrTi7oz8BLSYJHU6q8dZ0hion76lruGCr3dTRT2nYuD yuQMVAqFnvcwXX8rHEyDJG0tjR1MqpQh4uL0mE0HfqnirMdwJkBLT7xK3hvZZ58KoqU/GU gI26suu4fj4Xksl292RhTNIYQyPgAMZdi6e19OJOKsitYGe0APQSIrpmvDE07g== X-Migadu-Spam-Score: -0.58 X-Spam-Score: -0.58 X-Migadu-Queue-Id: 7F13ABF0B X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=muradm.net header.s=mail header.b=hS6RSk2l; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-TUID: 1c5c255YEjaz This fixes a regression from 543d971ed2a1d9eb934af1f51930741d7cc4e7ef whereby match-lambda due to configuration field reordering. * gnu/services/security.scm: [serialize-fail2ban-ignore-cache-configuration]: Switch to match-record. [serialize-fail2ban-jail-filter-configuration]: Switch to match-record. [serialize-fail2ban-jail-action-configuration]: Switch to match-record. --- gnu/services/security.scm | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/gnu/services/security.scm b/gnu/services/security.scm index 50111455fb..8116072920 100644 --- a/gnu/services/security.scm +++ b/gnu/services/security.scm @@ -42,11 +42,11 @@ (define-configuration/no-serialization fail2ban-ignore-cache-configuration (max-count integer "Cache size.") (max-time integer "Cache time.")) -(define serialize-fail2ban-ignore-cache-configuration - (match-lambda - (($ _ key max-count max-time) - (format #f "key=\"~a\", max-count=~d, max-time=~d" - key max-count max-time)))) +(define (serialize-fail2ban-ignore-cache-configuration config) + (match-record config + (key max-count max-time) + (format #f "key=\"~a\", max-count=~d, max-time=~d" + key max-count max-time))) (define-maybe/no-serialization string) @@ -54,10 +54,10 @@ (define-configuration/no-serialization fail2ban-jail-filter-configuration (name string "Filter to use.") (mode maybe-string "Mode for filter.")) -(define serialize-fail2ban-jail-filter-configuration - (match-lambda - (($ _ name mode) - (format #f "~a~@[[mode=~a]~]" name (maybe-value mode))))) +(define (serialize-fail2ban-jail-filter-configuration config) + (match-record config + (name mode) + (format #f "~a~@[[mode=~a]~]" name (maybe-value mode)))) (define (argument? a) (and (pair? a) @@ -86,17 +86,17 @@ (define (serialize-fail2ban-jail-action-configuration-arguments args) (format #f "~a=~a" (car e) (any-value (cdr e)))))) (format #f "~a" (string-join (map key-value args) ",")))) -(define serialize-fail2ban-jail-action-configuration - (match-lambda - (($ _ name arguments) - (format - #f "~a~a" - name - (if (null? arguments) "" - (format - #f "[~a]" - (serialize-fail2ban-jail-action-configuration-arguments - arguments))))))) +(define (serialize-fail2ban-jail-action-configuration config) + (match-record config + (name arguments) + (format + #f "~a~a" + name + (if (null? arguments) "" + (format + #f "[~a]" + (serialize-fail2ban-jail-action-configuration-arguments + arguments)))))) (define fail2ban-backend->string (match-lambda -- 2.38.1