From patchwork Sun May 4 08:56:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 42280 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BF7BA27BC4B; Sun, 4 May 2025 09:58:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3C6EE27BC49 for ; Sun, 4 May 2025 09:58:41 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBVAr-0001em-4E; Sun, 04 May 2025 04:58:13 -0400 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 1uBVAp-0001eJ-ES for guix-patches@gnu.org; Sun, 04 May 2025 04:58:12 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBVAp-00042c-4e for guix-patches@gnu.org; Sun, 04 May 2025 04:58:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=oJvWlY81aQRdMEPIHPuAcwK6RQSDjLAP0XdlJXdGzLE=; b=X8I2tjXIJsLrNx3m0zRCxJPrNyi2qfIGs7a3INvDiKyWY0+byRVSrgumtvfHaKhl94xmWEJx93iDVP4XDGcgVRxSxHuBe44QerG1FNejdWS00Jm6mE22yl2qnZUsMsFz6qwMXBqgmk0eSLm4GIsndpUI/VgEXEs2kHfs85IDk9piUGXEWnbt2FlMYZ0zP4kUW3Mp1Djjta5wePyJuzqv/VV9bBKXUpUfOwtnYDY8Pcsaffy6DM6+25rVZxoN8lkFh4ulBFn3ebBnA7cdfIkd2/Hgc4rwoWCcOePyevaxgzXc52UlP4y3MsaGRO2/fGR6+V7Hu/kGBuRoqq0/pv0fnQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBVAp-0000PN-0U for guix-patches@gnu.org; Sun, 04 May 2025 04:58:11 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78066] [PATCH v3 1/6] gnu: fail2ban: Move file deletion to source snippet. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 May 2025 08:58:10 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78066@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78066-submit@debbugs.gnu.org id=B78066.17463490831460 (code B ref 78066); Sun, 04 May 2025 08:58:10 +0000 Received: (at 78066) by debbugs.gnu.org; 4 May 2025 08:58:03 +0000 Received: from localhost ([127.0.0.1]:51330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBVAe-0000Mv-CG for submit@debbugs.gnu.org; Sun, 04 May 2025 04:58:01 -0400 Received: from 1.mo562.mail-out.ovh.net ([178.33.109.175]:56941) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBVAX-0000Lw-5n for 78066@debbugs.gnu.org; Sun, 04 May 2025 04:57:57 -0400 Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net [152.228.215.222]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz7z3Nhyz1VwY; Sun, 4 May 2025 08:57:51 +0000 (UTC) Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net. [127.0.0.1]) by director3.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78066@debbugs.gnu.org>; Sun, 4 May 2025 08:57:51 +0000 (UTC) Received: from mta7.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.109.176.114]) by director3.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz7z2D1Qz6252; Sun, 4 May 2025 08:57:51 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.0]) by mta7.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id DC3CCC3AB0; Sun, 4 May 2025 08:57:50 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-101G004d7036f4b-8b5f-434c-958f-ca844d776698, 8CD8A0E5D230CF78A323F194FBE8D47D3072D94D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 4 May 2025 10:56:21 +0200 Message-ID: <20250504085747.6387-2-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250504085747.6387-1-ngraves@ngraves.fr> References: <20250504085747.6387-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3174756266389594850 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeejjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdekuedujeeukeelfeevheeiueeuhedttdfhfeefudekhedujeehleeiffehjeelnecuffhomhgrihhnpehsvghtuhhprdhphienucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeektdeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpoffvtefjohhsthepmhhoheeivdgmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=oJvWlY81aQRdMEPIHPuAcwK6RQSDjLAP0XdlJXdGzLE=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1746349071; v=1; b=C7x7pToP4853bzGNV535c2JmaCJGhcJoSKdRiiokoU1hWfDqOuCEIGsvB/MhBmNAJuJBrrsO 6n2F0fMgNwopag7yvxubjXfJa8SaSKIuanVdBD24MXMrSVTMF+DxkPvzaye+2B8l3LwOsy5zfK8 K+atKR47aGjoJ2T7BJqjeWYF4teyCmmrZJoFLrKiKvfGzffb1xb2hH4eXRouXONurxsk5V244Y9 7ddDcdJrIHVUBrsLLoFM3kcsNqsk2gCEUWgcPCN7WXMZZ7tloYtJsRjhsK2AIDuzoW2gn3un7wJ kks2xbqH3VjyYlm0QEcCl1Pp9BaVKqDx/2iqLn8yAQ+SQ== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (fail2ban) [arguments]: Move multiple file deletion from here... [source]: ...to here. --- gnu/packages/admin.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 1d0ec121ff..216776e62c 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -6185,6 +6185,15 @@ (define-public fail2ban (modules '((guix build utils))) (snippet '(begin + ;; Replacing those by our own paths-guix.conf + (with-directory-excursion "config" + (for-each delete-file + '("paths-arch.conf" + "paths-debian.conf" + "paths-fedora.conf" + "paths-freebsd.conf" + "paths-opensuse.conf" + "paths-osx.conf"))) ;; Get rid of absolute file names. (substitute* "setup.py" (("/etc/fail2ban") @@ -6248,14 +6257,6 @@ (define-public fail2ban (lambda* (#:key inputs #:allow-other-keys) ;; deleting things that are not feasible to fix ;; or won't be used any way - (with-directory-excursion "config" - (for-each delete-file - '("paths-arch.conf" - "paths-debian.conf" - "paths-fedora.conf" - "paths-freebsd.conf" - "paths-opensuse.conf" - "paths-osx.conf"))) (with-directory-excursion "config/action.d" (for-each delete-file '("apf.conf" From patchwork Sun May 4 08:56:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 42285 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 50B3127BC4B; Sun, 4 May 2025 10:00:04 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C4CC027BC49 for ; Sun, 4 May 2025 10:00:03 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBVC5-0001ra-Qb; Sun, 04 May 2025 04:59:29 -0400 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 1uBVBy-0001oj-64 for guix-patches@gnu.org; Sun, 04 May 2025 04:59:22 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBVBf-000453-96 for guix-patches@gnu.org; Sun, 04 May 2025 04:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=7DqOXXhPNgAzuO4/S/ZQz3pDdaV30dgMFewJn/U75Xo=; b=uoZqnbPguhZMupHSjh+ApKB/aAnobzxJZdmdFrgE359oHpSeVKuttzPutruCLDm5xfnVgUlw0STHsnpKuiO/remwHXr+nh8VX0Om963GYfRrEZuLnZhFNb/ALzaG4RVHKhg4Vly0561zjnLBWvt+sfaBpW82LyehuzQ/fh52fjJg6Su8hUziy7GaZGU2cyMKyvAqXmfMKxUJSnaRt2vW2u4EnHWIelgC4FNkYPwFeiGDEK1Nx7izRJmc5QN4wF/OzqRbcWxl2Yneoxu0DRtRx0AZ/7Gghv/lHZwawDkZ99PHNuNxRG4skj621g+7uORGprw3WhypTyn6uJ9lEN6U/A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBVBf-0000WU-3w for guix-patches@gnu.org; Sun, 04 May 2025 04:59:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78066] [PATCH v3 2/6] gnu: fail2ban: Move setup and test patches to phases. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 May 2025 08:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78066@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78066-submit@debbugs.gnu.org id=B78066.17463490931612 (code B ref 78066); Sun, 04 May 2025 08:59:03 +0000 Received: (at 78066) by debbugs.gnu.org; 4 May 2025 08:58:13 +0000 Received: from localhost ([127.0.0.1]:51336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBVAq-0000Pp-PA for submit@debbugs.gnu.org; Sun, 04 May 2025 04:58:13 -0400 Received: from 5.mo562.mail-out.ovh.net ([46.105.48.192]:39411) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBVAX-0000M2-Pw for 78066@debbugs.gnu.org; Sun, 04 May 2025 04:57:59 -0400 Received: from director4.derp.mail-out.ovh.net (director4.derp.mail-out.ovh.net [79.137.60.37]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz803QLQz184j; Sun, 4 May 2025 08:57:52 +0000 (UTC) Received: from director4.derp.mail-out.ovh.net (director4.derp.mail-out.ovh.net. [127.0.0.1]) by director4.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78066@debbugs.gnu.org>; Sun, 4 May 2025 08:57:52 +0000 (UTC) Received: from mta2.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.110.188.244]) by director4.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz802FRlz2cHd; Sun, 4 May 2025 08:57:52 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.3]) by mta2.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id 008C0BA3FD0; Sun, 4 May 2025 08:57:51 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-111S0057f14ee90-dfbd-4ae8-89fb-4f5f675df78c, 8CD8A0E5D230CF78A323F194FBE8D47D3072D94D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 4 May 2025 10:56:22 +0200 Message-ID: <20250504085747.6387-3-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250504085747.6387-1-ngraves@ngraves.fr> References: <20250504085747.6387-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3175037739246805730 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeejjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdeltddrledvrdduudejrddugeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejkedtieeiseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdfovfetjfhoshhtpehmohehiedvmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=7DqOXXhPNgAzuO4/S/ZQz3pDdaV30dgMFewJn/U75Xo=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1746349072; v=1; b=tjAeeWtRDalECX07czbrVhGbR+fC0aryG2RXB83TIqslZb/8D9i2ky6Hv6qCDPZa8O4HFznn z4OT88Yt0aroT2YJYld3OARu3UII4VJMMM/TTo5++HaoDha+u9zRulOSFLSHvx9al2cAPtFuE01 l5CFeN69Eo1TTKCjKrpdZrTcj9MvNgkSB0rAgZhtRb09XXUVEfWH+DkzAMdDmhTIyzvWptZpinE XkKnWxZ2VwcHzyKYC0rVkrVvgDlDkYuXZ5accBKWaRHVjVaG1rTUQMdJojoayI7btNn7iLC22QP PAvC2E3xnmB6C7C5lujvl0dC/rmZycI44b0mIhiuhdP1A== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (fail2ban) [source]: Move setup and test substitutions... [arguments]: ...to phases 'patch-setup.py and 'disable-some-tests. --- gnu/packages/admin.scm | 71 +++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 216776e62c..d47a1935c3 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -6193,42 +6193,7 @@ (define-public fail2ban "paths-fedora.conf" "paths-freebsd.conf" "paths-opensuse.conf" - "paths-osx.conf"))) - ;; Get rid of absolute file names. - (substitute* "setup.py" - (("/etc/fail2ban") - "etc/fail2ban") - (("/var/lib/fail2ban") - "var/lib/fail2ban") - (("\"/usr/bin/\"") - "\"usr/bin/\"") - (("\"/usr/lib/fail2ban/\"") - "\"usr/lib/fail2ban/\"") - (("'/usr/share/doc/fail2ban'") - "'usr/share/doc/fail2ban'")) - ;; disable tests performing unacceptable side-effects - (let ((make-suite (lambda (t) - (string-append - "tests.addTest.unittest.makeSuite." - t "..")))) - (substitute* "fail2ban/tests/utils.py" - (((make-suite "actiontestcase.CommandActionTest")) - "") - (((make-suite "misctestcase.SetupTest")) - "") - (((make-suite - "filtertestcase.DNSUtilsNetworkTests")) - "") - (((make-suite "filtertestcase.IgnoreIPDNS")) - "") - (((make-suite "filtertestcase.GetFailures")) - "") - (((make-suite - "fail2banclienttestcase.Fail2banServerTest")) - "") - (((make-suite - "servertestcase.ServerConfigReaderTests")) - ""))))) + "paths-osx.conf"))))) (patches (search-patches "fail2ban-0.11.2_fix-setuptools-drop-2to3.patch" "fail2ban-python310-server-action.patch" @@ -6243,6 +6208,40 @@ (define-public fail2ban (add-before 'build 'invoke-2to3 (lambda _ (invoke "./fail2ban-2to3"))) + (add-after 'unpack 'patch-setup.py + (lambda _ + ;; Get rid of absolute file names. + (substitute* "setup.py" + (("/etc/fail2ban") + "etc/fail2ban") + (("/var/lib/fail2ban") + "var/lib/fail2ban") + (("\"/usr/bin/\"") + "\"usr/bin/\"") + (("\"/usr/lib/fail2ban/\"") + "\"usr/lib/fail2ban/\"") + (("'/usr/share/doc/fail2ban'") + "'usr/share/doc/fail2ban'")))) + (add-after 'unpack 'disable-some-tests + (lambda _ + (define (make-suite str) + (string-append "tests.addTest.unittest.makeSuite." str "..")) + ;; disable tests performing unacceptable side-effects + (substitute* "fail2ban/tests/utils.py" + (((make-suite "actiontestcase.CommandActionTest")) + "") + (((make-suite "misctestcase.SetupTest")) + "") + (((make-suite "filtertestcase.DNSUtilsNetworkTests")) + "") + (((make-suite "filtertestcase.IgnoreIPDNS")) + "") + (((make-suite "filtertestcase.GetFailures")) + "") + (((make-suite "fail2banclienttestcase.Fail2banServerTest")) + "") + (((make-suite "servertestcase.ServerConfigReaderTests")) + "")))) (add-before 'install 'fix-default-config (lambda* (#:key outputs #:allow-other-keys) (substitute* '("config/paths-common.conf" From patchwork Sun May 4 08:56:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 42283 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 090BB27BC4B; Sun, 4 May 2025 09:59:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 91A9927BC49 for ; Sun, 4 May 2025 09:59:57 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBVC5-0001qn-FH; Sun, 04 May 2025 04:59:29 -0400 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 1uBVBy-0001om-8n for guix-patches@gnu.org; Sun, 04 May 2025 04:59:22 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBVBg-00045A-Mn for guix-patches@gnu.org; Sun, 04 May 2025 04:59:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=cZ3+DlWOLrpiJtDN/rLa4E0jRUHGtdBHu/RvwJJVfo0=; b=RrBm0I+inAUXlGxEcVcQ1is5IjfMGKZjf2N/ImW8VmHOcoASEfUDJUzy3hGRcyq5KBAI44i1cZLGgXGpDQX0pPc0BiR78QzrRzSgR7+fV5La3XjNOYVENGb2pQW7EVkvuqxQB6KAkHXQyffbvjjVRzUHIyCieWcicUkc5PQQrdm0vEoQ/KrCIQPggPZlzRzRlznX4SXhLN40+GX04fwZxtGcujAQFp+V56Uxoo4rsoziixapUMb42n/qd1hh4+yZN4K0sUDhgJmuwuDR0zH6JrhjVbFFJhNAelkseZqZ27wUuXa9ZtotHMUhJ6G5lQZsh9h8zD02UJU/jpsorxpqXw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBVBg-0000Ws-Hz for guix-patches@gnu.org; Sun, 04 May 2025 04:59:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78066] [PATCH v3 3/6] gnu: fail2ban: Update to 1.1.0. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 May 2025 08:59:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78066@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78066-submit@debbugs.gnu.org id=B78066.17463491001680 (code B ref 78066); Sun, 04 May 2025 08:59:04 +0000 Received: (at 78066) by debbugs.gnu.org; 4 May 2025 08:58:20 +0000 Received: from localhost ([127.0.0.1]:51342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBVAt-0000QF-6u for submit@debbugs.gnu.org; Sun, 04 May 2025 04:58:18 -0400 Received: from 5.mo562.mail-out.ovh.net ([46.105.48.192]:43041) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBVAY-0000M4-DA for 78066@debbugs.gnu.org; Sun, 04 May 2025 04:58:04 -0400 Received: from director2.derp.mail-out.ovh.net (director2.derp.mail-out.ovh.net [79.137.60.36]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz813sXfz1W0m; Sun, 4 May 2025 08:57:53 +0000 (UTC) Received: from director2.derp.mail-out.ovh.net (director2.derp.mail-out.ovh.net. [127.0.0.1]) by director2.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78066@debbugs.gnu.org>; Sun, 4 May 2025 08:57:53 +0000 (UTC) Received: from mta7.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.108.17.212]) by director2.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz812z02z2D4D; Sun, 4 May 2025 08:57:53 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.3]) by mta7.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id 05E39C3AB1; Sun, 4 May 2025 08:57:52 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-114S008558caae1-0b35-485a-b739-c48341e192b2, 8CD8A0E5D230CF78A323F194FBE8D47D3072D94D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 4 May 2025 10:56:23 +0200 Message-ID: <20250504085747.6387-4-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250504085747.6387-1-ngraves@ngraves.fr> References: <20250504085747.6387-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3175319213825909474 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeejjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdeltddrledvrdduudejrddugeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejkedtieeiseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdfovfetjfhoshhtpehmohehiedvmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=cZ3+DlWOLrpiJtDN/rLa4E0jRUHGtdBHu/RvwJJVfo0=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1746349073; v=1; b=zL1W0NudhSBMw6p6ee81aRzcnwYwgtYK0DgwXdwarN8st7U3+jWo0gpsM6vZREHXLPY0XOyr D15J0CtiY8ZVxMs4STfhlfiefyQb19z7goUcQa5rwRMTQiiEtTtoIaLVjpU9hYBpbYOHP8OwGdA zji+6CGIYcLxeKKC62FRomchWdof5NWxf+fkHUeE7jUduZE8p7kuqCq5tVYv2y/10q6zq0SQtHR sSCy975rI28KvbT3BpSW0VcmmYneuTZXhyX7H1TDZLWFT/LhyGBJ2p0bTw/+/0wyPeNq8HI9aM9 dGd1Xv8FisfzwSq94yuPy1YZlEPyODY1vc4hgMCDNjrcQ== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/fail2ban-0.11.2_CVE-2021-32749.patch, gnu/packages/fail2ban-0.11.2_fix-setuptools-drop-2to3.patch, gnu/packages/patches/fail2ban-0.11.2_fix-test-suite.patch, gnu/packages/patches/fail2ban-python310-server-action.patch, gnu/packages/fail2ban-python310-server-actions.patch: Delete patches. * gnu/local.mk: Deregister patches. * gnu/packages/admin.scm (fail2ban): Update to 1.1.0. [source]: Use (srfi srfi-26) for readability. : Deregister patches. [build-system]: Switch to pyproject-build-system. [arguments]: Remove phase 'invoke-2to3. Add phase 'avoid-external-binary-in-/bin to avoid creating a symlink to python-wrapper binary during installation (current 'install phase breaks otherwise). Run phases 'fix-default-config and 'set-action-dependencies before 'build phase (needed for pyproject). [native-inputs]: Add python-setuptools, python-wheel. --- gnu/local.mk | 6 - gnu/packages/admin.scm | 30 ++-- .../fail2ban-0.11.2_CVE-2021-32749.patch | 155 ------------------ ...2ban-0.11.2_fix-setuptools-drop-2to3.patch | 64 -------- .../fail2ban-0.11.2_fix-test-suite.patch | 48 ------ .../fail2ban-python310-server-action.patch | 27 --- .../fail2ban-python310-server-actions.patch | 25 --- .../fail2ban-python310-server-jails.patch | 25 --- 8 files changed, 14 insertions(+), 366 deletions(-) delete mode 100644 gnu/packages/patches/fail2ban-0.11.2_CVE-2021-32749.patch delete mode 100644 gnu/packages/patches/fail2ban-0.11.2_fix-setuptools-drop-2to3.patch delete mode 100644 gnu/packages/patches/fail2ban-0.11.2_fix-test-suite.patch delete mode 100644 gnu/packages/patches/fail2ban-python310-server-action.patch delete mode 100644 gnu/packages/patches/fail2ban-python310-server-actions.patch delete mode 100644 gnu/packages/patches/fail2ban-python310-server-jails.patch diff --git a/gnu/local.mk b/gnu/local.mk index f6f95bbf10..5269bfe5ee 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1259,13 +1259,7 @@ dist_patch_DATA = \ %D%/packages/patches/expat-CVE-2024-45492.patch \ %D%/packages/patches/extempore-unbundle-external-dependencies.patch \ %D%/packages/patches/extundelete-e2fsprogs-1.44.patch \ - %D%/packages/patches/fail2ban-0.11.2_CVE-2021-32749.patch \ - %D%/packages/patches/fail2ban-0.11.2_fix-setuptools-drop-2to3.patch \ - %D%/packages/patches/fail2ban-0.11.2_fix-test-suite.patch \ %D%/packages/patches/fail2ban-paths-guix-conf.patch \ - %D%/packages/patches/fail2ban-python310-server-action.patch \ - %D%/packages/patches/fail2ban-python310-server-actions.patch \ - %D%/packages/patches/fail2ban-python310-server-jails.patch \ %D%/packages/patches/faiss-tests-CMakeLists-find-googletest.patch \ %D%/packages/patches/falcosecurity-libs-shared-build.patch \ %D%/packages/patches/farstream-gupnp.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index d47a1935c3..c6dc8ff43c 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -6172,7 +6172,7 @@ (define-public sysdig (define-public fail2ban (package (name "fail2ban") - (version "0.11.2") + (version "1.1.0") (source (origin (method git-fetch) (uri (git-reference @@ -6181,7 +6181,7 @@ (define-public fail2ban (file-name (git-file-name name version)) (sha256 (base32 - "00d9q8m284q2wy6q462nipzszplfbvrs9fhgn0y3imwsc24kv1db")) + "0lfakna6ad2xwz95sjxzkavipcsxiy7ybavkdkf9zzmspf2ws4yk")) (modules '((guix build utils))) (snippet '(begin @@ -6194,20 +6194,16 @@ (define-public fail2ban "paths-freebsd.conf" "paths-opensuse.conf" "paths-osx.conf"))))) - (patches (search-patches - "fail2ban-0.11.2_fix-setuptools-drop-2to3.patch" - "fail2ban-python310-server-action.patch" - "fail2ban-python310-server-actions.patch" - "fail2ban-python310-server-jails.patch" - "fail2ban-0.11.2_fix-test-suite.patch" - "fail2ban-0.11.2_CVE-2021-32749.patch" - "fail2ban-paths-guix-conf.patch")))) - (build-system python-build-system) + (patches (search-patches "fail2ban-paths-guix-conf.patch")))) + (build-system pyproject-build-system) (arguments '(#:phases (modify-phases %standard-phases - (add-before 'build 'invoke-2to3 + (add-after 'unpack 'avoid-external-binary-in-/bin (lambda _ - (invoke "./fail2ban-2to3"))) + (delete-file "fail2ban/setup.py") + (substitute* '("bin/fail2ban-testcases" + "setup.py") + ((".*updatePyExec.*") "")))) (add-after 'unpack 'patch-setup.py (lambda _ ;; Get rid of absolute file names. @@ -6225,7 +6221,7 @@ (define-public fail2ban (add-after 'unpack 'disable-some-tests (lambda _ (define (make-suite str) - (string-append "tests.addTest.unittest.makeSuite." str "..")) + (string-append "tests.addTest\\(loadTests\\(" str "\\)\\)")) ;; disable tests performing unacceptable side-effects (substitute* "fail2ban/tests/utils.py" (((make-suite "actiontestcase.CommandActionTest")) @@ -6242,7 +6238,7 @@ (define (make-suite str) "") (((make-suite "servertestcase.ServerConfigReaderTests")) "")))) - (add-before 'install 'fix-default-config + (add-before 'build 'fix-default-config (lambda* (#:key outputs #:allow-other-keys) (substitute* '("config/paths-common.conf" "fail2ban/tests/utils.py" @@ -6327,7 +6323,7 @@ (define (make-suite str) (("_whois = whois") (string-append "_whois = " (bin "whois"))))) (substitute* "config/jail.conf" - (("before = paths-debian.conf") + (("before = paths-debian\\.conf") "before = paths-guix.conf")))) (add-after 'install 'copy-man-pages (lambda* (#:key outputs #:allow-other-keys) @@ -6351,6 +6347,8 @@ (define (make-suite str) "fail2ban-testcases")) (for-each install-man5 '("jail.conf"))))))))) + (native-inputs + (list python-setuptools python-wheel)) (inputs (list gawk coreutils-minimal curl diff --git a/gnu/packages/patches/fail2ban-0.11.2_CVE-2021-32749.patch b/gnu/packages/patches/fail2ban-0.11.2_CVE-2021-32749.patch deleted file mode 100644 index d3c677918c..0000000000 --- a/gnu/packages/patches/fail2ban-0.11.2_CVE-2021-32749.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 410a6ce5c80dd981c22752da034f2529b5eee844 Mon Sep 17 00:00:00 2001 -From: sebres -Date: Mon, 21 Jun 2021 17:12:53 +0200 -Subject: [PATCH] fixed possible RCE vulnerability, unset escape variable - (default tilde) stops consider "~" char after new-line as composing escape - sequence - ---- - config/action.d/complain.conf | 2 +- - config/action.d/dshield.conf | 2 +- - config/action.d/mail-buffered.conf | 8 ++++---- - config/action.d/mail-whois-lines.conf | 2 +- - config/action.d/mail-whois.conf | 6 +++--- - config/action.d/mail.conf | 6 +++--- - 6 files changed, 13 insertions(+), 13 deletions(-) - -diff --git a/config/action.d/complain.conf b/config/action.d/complain.conf -index 3a5f882c9f..4d73b05859 100644 ---- a/config/action.d/complain.conf -+++ b/config/action.d/complain.conf -@@ -102,7 +102,7 @@ logpath = /dev/null - # Notes.: Your system mail command. Is passed 2 args: subject and recipient - # Values: CMD - # --mailcmd = mail -s -+mailcmd = mail -E 'set escape' -s - - # Option: mailargs - # Notes.: Additional arguments to mail command. e.g. for standard Unix mail: -diff --git a/config/action.d/dshield.conf b/config/action.d/dshield.conf -index c128bef348..3d5a7a53a9 100644 ---- a/config/action.d/dshield.conf -+++ b/config/action.d/dshield.conf -@@ -179,7 +179,7 @@ tcpflags = - # Notes.: Your system mail command. Is passed 2 args: subject and recipient - # Values: CMD - # --mailcmd = mail -s -+mailcmd = mail -E 'set escape' -s - - # Option: mailargs - # Notes.: Additional arguments to mail command. e.g. for standard Unix mail: -diff --git a/config/action.d/mail-buffered.conf b/config/action.d/mail-buffered.conf -index 325f185b2f..79b841049c 100644 ---- a/config/action.d/mail-buffered.conf -+++ b/config/action.d/mail-buffered.conf -@@ -17,7 +17,7 @@ actionstart = printf %%b "Hi,\n - The jail has been started successfully.\n - Output will be buffered until lines are available.\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : started on " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : started on " - - # Option: actionstop - # Notes.: command executed at the stop of jail (or at the end of Fail2Ban) -@@ -28,13 +28,13 @@ actionstop = if [ -f ]; then - These hosts have been banned by Fail2Ban.\n - `cat ` - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : Summary from " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : Summary from " - rm - fi - printf %%b "Hi,\n - The jail has been stopped.\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : stopped on " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : stopped on " - - # Option: actioncheck - # Notes.: command executed once before each actionban command -@@ -55,7 +55,7 @@ actionban = printf %%b "`date`: ( failures)\n" >> - These hosts have been banned by Fail2Ban.\n - `cat ` - \nRegards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : Summary" -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : Summary" - rm - fi - -diff --git a/config/action.d/mail-whois-lines.conf b/config/action.d/mail-whois-lines.conf -index 3a3e56b2c7..d2818cb9b9 100644 ---- a/config/action.d/mail-whois-lines.conf -+++ b/config/action.d/mail-whois-lines.conf -@@ -72,7 +72,7 @@ actionunban = - # Notes.: Your system mail command. Is passed 2 args: subject and recipient - # Values: CMD - # --mailcmd = mail -s -+mailcmd = mail -E 'set escape' -s - - # Default name of the chain - # -diff --git a/config/action.d/mail-whois.conf b/config/action.d/mail-whois.conf -index 7fea34c40d..ab33b616dc 100644 ---- a/config/action.d/mail-whois.conf -+++ b/config/action.d/mail-whois.conf -@@ -20,7 +20,7 @@ norestored = 1 - actionstart = printf %%b "Hi,\n - The jail has been started successfully.\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : started on " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : started on " - - # Option: actionstop - # Notes.: command executed at the stop of jail (or at the end of Fail2Ban) -@@ -29,7 +29,7 @@ actionstart = printf %%b "Hi,\n - actionstop = printf %%b "Hi,\n - The jail has been stopped.\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : stopped on " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : stopped on " - - # Option: actioncheck - # Notes.: command executed once before each actionban command -@@ -49,7 +49,7 @@ actionban = printf %%b "Hi,\n - Here is more information about :\n - `%(_whois_command)s`\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : banned from " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : banned from " - - # Option: actionunban - # Notes.: command executed when unbanning an IP. Take care that the -diff --git a/config/action.d/mail.conf b/config/action.d/mail.conf -index 5d8c0e154c..f4838ddcb6 100644 ---- a/config/action.d/mail.conf -+++ b/config/action.d/mail.conf -@@ -16,7 +16,7 @@ norestored = 1 - actionstart = printf %%b "Hi,\n - The jail has been started successfully.\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : started on " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : started on " - - # Option: actionstop - # Notes.: command executed at the stop of jail (or at the end of Fail2Ban) -@@ -25,7 +25,7 @@ actionstart = printf %%b "Hi,\n - actionstop = printf %%b "Hi,\n - The jail has been stopped.\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : stopped on " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : stopped on " - - # Option: actioncheck - # Notes.: command executed once before each actionban command -@@ -43,7 +43,7 @@ actionban = printf %%b "Hi,\n - The IP has just been banned by Fail2Ban after - attempts against .\n - Regards,\n -- Fail2Ban"|mail -s "[Fail2Ban] : banned from " -+ Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] : banned from " - - # Option: actionunban - # Notes.: command executed when unbanning an IP. Take care that the diff --git a/gnu/packages/patches/fail2ban-0.11.2_fix-setuptools-drop-2to3.patch b/gnu/packages/patches/fail2ban-0.11.2_fix-setuptools-drop-2to3.patch deleted file mode 100644 index b0b14364b1..0000000000 --- a/gnu/packages/patches/fail2ban-0.11.2_fix-setuptools-drop-2to3.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 5ac303df8a171f748330d4c645ccbf1c2c7f3497 Mon Sep 17 00:00:00 2001 -From: sebres -Date: Sun, 19 Sep 2021 18:49:18 +0200 -Subject: [PATCH] fix gh-3098: build fails with error in fail2ban setup - command: use_2to3 is invalid (setuptools 58+) - ---- - setup.py | 16 +--------------- - 1 file changed, 1 insertion(+), 15 deletions(-) - -diff --git a/setup.py b/setup.py -index f4c2550f6f..98413273c5 100755 ---- a/setup.py -+++ b/setup.py -@@ -48,7 +48,7 @@ - from glob import glob - - from fail2ban.setup import updatePyExec -- -+from fail2ban.version import version - - source_dir = os.path.realpath(os.path.dirname( - # __file__ seems to be overwritten sometimes on some python versions (e.g. bug of 2.6 by running under cProfile, etc.): -@@ -112,22 +112,12 @@ def update_scripts(self, dry_run=False): - # Wrapper to specify fail2ban own options: - class install_command_f2b(install): - user_options = install.user_options + [ -- ('disable-2to3', None, 'Specify to deactivate 2to3, e.g. if the install runs from fail2ban test-cases.'), - ('without-tests', None, 'without tests files installation'), - ] - def initialize_options(self): -- self.disable_2to3 = None - self.without_tests = not with_tests - install.initialize_options(self) - def finalize_options(self): -- global _2to3 -- ## in the test cases 2to3 should be already done (fail2ban-2to3): -- if self.disable_2to3: -- _2to3 = False -- if _2to3: -- cmdclass = self.distribution.cmdclass -- cmdclass['build_py'] = build_py_2to3 -- cmdclass['build_scripts'] = build_scripts_2to3 - if self.without_tests: - self.distribution.scripts.remove('bin/fail2ban-testcases') - -@@ -178,7 +168,6 @@ def run(self): - if setuptools: - setup_extra = { - 'test_suite': "fail2ban.tests.utils.gatherTests", -- 'use_2to3': True, - } - else: - setup_extra = {} -@@ -202,9 +191,6 @@ def run(self): - ('/usr/share/doc/fail2ban', doc_files) - ) - --# Get version number, avoiding importing fail2ban. --# This is due to tests not functioning for python3 as 2to3 takes place later --exec(open(join("fail2ban", "version.py")).read()) - - setup( - name = "fail2ban", diff --git a/gnu/packages/patches/fail2ban-0.11.2_fix-test-suite.patch b/gnu/packages/patches/fail2ban-0.11.2_fix-test-suite.patch deleted file mode 100644 index 91d973e72e..0000000000 --- a/gnu/packages/patches/fail2ban-0.11.2_fix-test-suite.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 747d4683221b5584f9663695fb48145689b42ceb Mon Sep 17 00:00:00 2001 -From: sebres -Date: Mon, 4 Jan 2021 02:42:38 +0100 -Subject: [PATCH] fixes century selector of %ExY and %Exy in datepattern for - tests, considering interval from 2005 (alternate now) to now; + better - grouping algorithm for resulting century RE - ---- - fail2ban/server/strptime.py | 24 ++++++++++++++++++++++-- - 1 file changed, 22 insertions(+), 2 deletions(-) - -diff --git a/fail2ban/server/strptime.py b/fail2ban/server/strptime.py -index 1464a96d1f..39fc795865 100644 ---- a/fail2ban/server/strptime.py -+++ b/fail2ban/server/strptime.py -@@ -36,10 +36,30 @@ def _getYearCentRE(cent=(0,3), distance=3, now=(MyTime.now(), MyTime.alternateNo - Thereby respect possible run in the test-cases (alternate date used there) - """ - cent = lambda year, f=cent[0], t=cent[1]: str(year)[f:t] -+ def grp(exprset): -+ c = None -+ if len(exprset) > 1: -+ for i in exprset: -+ if c is None or i[0:-1] == c: -+ c = i[0:-1] -+ else: -+ c = None -+ break -+ if not c: -+ for i in exprset: -+ if c is None or i[0] == c: -+ c = i[0] -+ else: -+ c = None -+ break -+ if c: -+ return "%s%s" % (c, grp([i[len(c):] for i in exprset])) -+ return ("(?:%s)" % "|".join(exprset) if len(exprset[0]) > 1 else "[%s]" % "".join(exprset)) \ -+ if len(exprset) > 1 else "".join(exprset) - exprset = set( cent(now[0].year + i) for i in (-1, distance) ) - if len(now) and now[1]: -- exprset |= set( cent(now[1].year + i) for i in (-1, distance) ) -- return "(?:%s)" % "|".join(exprset) if len(exprset) > 1 else "".join(exprset) -+ exprset |= set( cent(now[1].year + i) for i in xrange(-1, now[0].year-now[1].year+1, distance) ) -+ return grp(sorted(list(exprset))) - - timeRE = TimeRE() - diff --git a/gnu/packages/patches/fail2ban-python310-server-action.patch b/gnu/packages/patches/fail2ban-python310-server-action.patch deleted file mode 100644 index 723d7f7aa6..0000000000 --- a/gnu/packages/patches/fail2ban-python310-server-action.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2b6bb2c1bed8f7009631e8f8c306fa3160324a49 Mon Sep 17 00:00:00 2001 -From: "Sergey G. Brester" -Date: Mon, 8 Feb 2021 17:19:24 +0100 -Subject: [PATCH] follow bpo-37324: :ref:`collections-abstract-base-classes` - moved to the :mod:`collections.abc` module - -(since 3.10-alpha.5 `MutableMapping` is missing in collections module) ---- - fail2ban/server/action.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/fail2ban/server/action.py b/fail2ban/server/action.py -index 3bc48fe046..f0f1e6f59a 100644 ---- a/fail2ban/server/action.py -+++ b/fail2ban/server/action.py -@@ -30,7 +30,10 @@ - import threading - import time - from abc import ABCMeta --from collections import MutableMapping -+try: -+ from collections.abc import MutableMapping -+except ImportError: -+ from collections import MutableMapping - - from .failregex import mapTag2Opt - from .ipdns import DNSUtils diff --git a/gnu/packages/patches/fail2ban-python310-server-actions.patch b/gnu/packages/patches/fail2ban-python310-server-actions.patch deleted file mode 100644 index e31316d28b..0000000000 --- a/gnu/packages/patches/fail2ban-python310-server-actions.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 42dee38ad2ac5c3f23bdf297d824022923270dd9 Mon Sep 17 00:00:00 2001 -From: "Sergey G. Brester" -Date: Mon, 8 Feb 2021 17:25:45 +0100 -Subject: [PATCH] amend for `Mapping` - ---- - fail2ban/server/actions.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/fail2ban/server/actions.py b/fail2ban/server/actions.py -index b7b95b445a..897d907c1a 100644 ---- a/fail2ban/server/actions.py -+++ b/fail2ban/server/actions.py -@@ -28,7 +28,10 @@ - import os - import sys - import time --from collections import Mapping -+try: -+ from collections.abc import Mapping -+except ImportError: -+ from collections import Mapping - try: - from collections import OrderedDict - except ImportError: diff --git a/gnu/packages/patches/fail2ban-python310-server-jails.patch b/gnu/packages/patches/fail2ban-python310-server-jails.patch deleted file mode 100644 index e5873c415e..0000000000 --- a/gnu/packages/patches/fail2ban-python310-server-jails.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9f1d1f4fbd0804695a976beb191f2c49a2739834 Mon Sep 17 00:00:00 2001 -From: "Sergey G. Brester" -Date: Mon, 8 Feb 2021 17:35:59 +0100 -Subject: [PATCH] amend for `Mapping` (jails) - ---- - fail2ban/server/jails.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/fail2ban/server/jails.py b/fail2ban/server/jails.py -index 972a8c4bd2..27e12ddf65 100644 ---- a/fail2ban/server/jails.py -+++ b/fail2ban/server/jails.py -@@ -22,7 +22,10 @@ - __license__ = "GPL" - - from threading import Lock --from collections import Mapping -+try: -+ from collections.abc import Mapping -+except ImportError: -+ from collections import Mapping - - from ..exceptions import DuplicateJailException, UnknownJailException - from .jail import Jail From patchwork Sun May 4 08:56:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 42284 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8359927BC4A; Sun, 4 May 2025 10:00:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EE13E27BC49 for ; Sun, 4 May 2025 10:00:00 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBVC3-0001q8-Ai; Sun, 04 May 2025 04:59:27 -0400 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 1uBVBy-0001ol-77 for guix-patches@gnu.org; Sun, 04 May 2025 04:59:22 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBVBg-000458-82 for guix-patches@gnu.org; Sun, 04 May 2025 04:59:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=6t8UMI4AC5atqsIVab+hIQPBr9IeHJvJg7WLEAyevto=; b=LO5Lcqlz6o/5A6rWROn9Ne3mbYnod/5//TedG/yWbP1bVpkEsz/SBz9DaVwQ5veI/iTaIU2VK2JrCHXT3jh42USRRn2BwK6Q6SyQ/8CdEPiVer/9JXkrEngOaUWQtB7Ow8ff8l1EvKmrsEaM0WT1BfDEhfwHl5BSZFaE156h4OklWgl3/PhDCyqrIhWx/oiN3zoSFwUKrHlq5ISdIZp/ZhglJx+lSaeV/IQVrsQgKsFvJkdtlRgiAjdDLcKxmYsxYGnSZ5hob7cLp7gWHHhwjYKagpWoR+RUT1/1qOYRjfPN7a5BLtUrEaYqd2LFoOAlxKuZuOeVxPBuLCV0i6MhUg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBVBg-0000Wj-3S for guix-patches@gnu.org; Sun, 04 May 2025 04:59:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78066] [PATCH v3 4/6] gnu: fail2ban: Improve style. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 May 2025 08:59:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78066@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78066-submit@debbugs.gnu.org id=B78066.17463490951630 (code B ref 78066); Sun, 04 May 2025 08:59:04 +0000 Received: (at 78066) by debbugs.gnu.org; 4 May 2025 08:58:15 +0000 Received: from localhost ([127.0.0.1]:51340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBVAs-0000Q6-68 for submit@debbugs.gnu.org; Sun, 04 May 2025 04:58:15 -0400 Received: from 7.mo563.mail-out.ovh.net ([46.105.59.58]:46057) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBVAa-0000M6-8I for 78066@debbugs.gnu.org; Sun, 04 May 2025 04:58:00 -0400 Received: from director1.derp.mail-out.ovh.net (director1.derp.mail-out.ovh.net [51.68.80.175]) by mo563.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz825LSLz1SdW; Sun, 4 May 2025 08:57:54 +0000 (UTC) Received: from director1.derp.mail-out.ovh.net (director1.derp.mail-out.ovh.net. [127.0.0.1]) by director1.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78066@debbugs.gnu.org>; Sun, 4 May 2025 08:57:54 +0000 (UTC) Received: from mta2.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.110.118.229]) by director1.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz821gsKz61pS; Sun, 4 May 2025 08:57:54 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.3]) by mta2.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id D4DADBA3F92; Sun, 4 May 2025 08:57:53 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-99G00395f8d8fb-69bc-42e8-b12f-c073ea7d4510, 8CD8A0E5D230CF78A323F194FBE8D47D3072D94D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 4 May 2025 10:56:24 +0200 Message-ID: <20250504085747.6387-5-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250504085747.6387-1-ngraves@ngraves.fr> References: <20250504085747.6387-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3175600691197436642 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeejjeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdehleeiffehtedvlefhffffjeefgfduhfetkeevheeiteduiedugfekuedtheejnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeektdeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpoffvtefjohhsthepmhhoheeifegmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=6t8UMI4AC5atqsIVab+hIQPBr9IeHJvJg7WLEAyevto=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1746349074; v=1; b=a2Veah8IuLEIHzfMWHeYEksV4Pgp9hZPOw94Du8s4SpWr+VwgvylLDiDPpxuiVDgBNGHjeoo iYeWQXKFH1M08OVxm2NUxQ5w6fajYhosz9BC45653HKVPFZ//vu5t8iUU/AHnaMOUmAUyVfy+YQ LXbvOglhmIuXyeBJCCzR3bZgyU0nAMYY1nu6UemJihFovPxgOsXFBvQrYYdchKUyzfrZeF6gGVJ kpdIBOjUQEQ42Uq3YkFtn+2JncPxVQhqpFhnUNWsyJVq0/9OCSUdy4+xPQXBZf0JilSapp0MZPE 8BoC6VRQgWTKNFHmGFgZFPaTRDpcCJiiyaN6VdtwKDMZw== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (fail2ban): Use gexps and run guix style. --- gnu/packages/admin.scm | 338 ++++++++++++++++++++--------------------- 1 file changed, 164 insertions(+), 174 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index c6dc8ff43c..c9dd154313 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -6173,182 +6173,172 @@ (define-public fail2ban (package (name "fail2ban") (version "1.1.0") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/fail2ban/fail2ban") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0lfakna6ad2xwz95sjxzkavipcsxiy7ybavkdkf9zzmspf2ws4yk")) - (modules '((guix build utils))) - (snippet - '(begin - ;; Replacing those by our own paths-guix.conf - (with-directory-excursion "config" - (for-each delete-file - '("paths-arch.conf" - "paths-debian.conf" - "paths-fedora.conf" - "paths-freebsd.conf" - "paths-opensuse.conf" - "paths-osx.conf"))))) - (patches (search-patches "fail2ban-paths-guix-conf.patch")))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/fail2ban/fail2ban") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0lfakna6ad2xwz95sjxzkavipcsxiy7ybavkdkf9zzmspf2ws4yk")) + (modules '((guix build utils))) + (snippet #~(begin + ;; Replacing those by our own paths-guix.conf + (with-directory-excursion "config" + (for-each delete-file + '("paths-arch.conf" "paths-debian.conf" + "paths-fedora.conf" "paths-freebsd.conf" + "paths-opensuse.conf" "paths-osx.conf"))))) + (patches (search-patches "fail2ban-paths-guix-conf.patch")))) (build-system pyproject-build-system) (arguments - '(#:phases (modify-phases %standard-phases - (add-after 'unpack 'avoid-external-binary-in-/bin - (lambda _ - (delete-file "fail2ban/setup.py") - (substitute* '("bin/fail2ban-testcases" - "setup.py") - ((".*updatePyExec.*") "")))) - (add-after 'unpack 'patch-setup.py - (lambda _ - ;; Get rid of absolute file names. - (substitute* "setup.py" - (("/etc/fail2ban") - "etc/fail2ban") - (("/var/lib/fail2ban") - "var/lib/fail2ban") - (("\"/usr/bin/\"") - "\"usr/bin/\"") - (("\"/usr/lib/fail2ban/\"") - "\"usr/lib/fail2ban/\"") - (("'/usr/share/doc/fail2ban'") - "'usr/share/doc/fail2ban'")))) - (add-after 'unpack 'disable-some-tests - (lambda _ - (define (make-suite str) - (string-append "tests.addTest\\(loadTests\\(" str "\\)\\)")) - ;; disable tests performing unacceptable side-effects - (substitute* "fail2ban/tests/utils.py" - (((make-suite "actiontestcase.CommandActionTest")) - "") - (((make-suite "misctestcase.SetupTest")) - "") - (((make-suite "filtertestcase.DNSUtilsNetworkTests")) - "") - (((make-suite "filtertestcase.IgnoreIPDNS")) - "") - (((make-suite "filtertestcase.GetFailures")) - "") - (((make-suite "fail2banclienttestcase.Fail2banServerTest")) - "") - (((make-suite "servertestcase.ServerConfigReaderTests")) - "")))) - (add-before 'build 'fix-default-config - (lambda* (#:key outputs #:allow-other-keys) - (substitute* '("config/paths-common.conf" - "fail2ban/tests/utils.py" - "fail2ban/client/configreader.py" - "fail2ban/client/fail2bancmdline.py" - "fail2ban/client/fail2banregex.py") - (("/etc/fail2ban") - (string-append (assoc-ref outputs "out") - "/etc/fail2ban"))))) - (add-after 'fix-default-config 'set-action-dependencies - (lambda* (#:key inputs #:allow-other-keys) - ;; deleting things that are not feasible to fix - ;; or won't be used any way - (with-directory-excursion "config/action.d" - (for-each delete-file - '("apf.conf" - "bsd-ipfw.conf" - "dshield.conf" - "ipfilter.conf" - "ipfw.conf" - "firewallcmd-allports.conf" - "firewallcmd-common.conf" - "firewallcmd-ipset.conf" - "firewallcmd-multiport.conf" - "firewallcmd-new.conf" - "firewallcmd-rich-logging.conf" - "firewallcmd-rich-rules.conf" - "osx-afctl.conf" - "osx-ipfw.conf" - "pf.conf" - "nginx-block-map.conf" - "npf.conf" - "shorewall.conf" - "shorewall-ipset-proto6.conf" - "ufw.conf"))) - (let* ((lookup-cmd (lambda (i) - (search-input-file inputs i))) - (bin (lambda (i) - (lookup-cmd (string-append "/bin/" i)))) - (sbin (lambda (i) - (lookup-cmd (string-append "/sbin/" i)))) - (ip (sbin "ip")) - (sendmail (sbin "sendmail"))) - (substitute* (find-files "config/action.d" "\\.conf$") - ;; TODO: deal with geoiplookup .. - (("(awk|curl|dig|jq)" all cmd) - (bin cmd)) - (("(cat|echo|grep|head|printf|wc) " all - cmd) - (string-append (bin cmd) " ")) - ((" (date|rm|sed|tail|touch|tr) " all - cmd) - (string-append " " - (bin cmd) " ")) - (("cut -d") - (string-append (bin "cut") " -d")) - (("`date`") - (string-append "`" - (bin "date") "`")) - (("id -") - (string-append (bin "id") " -")) - (("ip -([46]) addr" all ver) - (string-append ip " -" ver " addr")) - (("ip route") - (string-append ip " route")) - (("ipset ") - (string-append (sbin "ipset") " ")) - (("(iptables|ip6tables) <" all cmd) - (string-append (sbin cmd) " <")) - (("/usr/bin/nsupdate") - (bin "nsupdate")) - (("mail -E") - (string-append sendmail " -E")) - (("nftables = nft") - (string-append "nftables = " (sbin "nft"))) - (("perl -e") - (string-append (bin "perl") " -e")) - (("/usr/sbin/sendmail") - sendmail) - (("test -e") - (string-append (bin "test") " -e")) - (("_whois = whois") - (string-append "_whois = " (bin "whois"))))) - (substitute* "config/jail.conf" - (("before = paths-debian\\.conf") - "before = paths-guix.conf")))) - (add-after 'install 'copy-man-pages - (lambda* (#:key outputs #:allow-other-keys) - (let* ((man (string-append (assoc-ref outputs "out") - "/man")) - (install-man (lambda (m) - (lambda (f) - (install-file (string-append f - "." m) - (string-append man - "/man" m))))) - (install-man1 (install-man "1")) - (install-man5 (install-man "5"))) - (with-directory-excursion "man" - (for-each install-man1 - '("fail2ban" - "fail2ban-client" - "fail2ban-python" - "fail2ban-regex" - "fail2ban-server" - "fail2ban-testcases")) - (for-each install-man5 - '("jail.conf"))))))))) - (native-inputs - (list python-setuptools python-wheel)) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'avoid-external-binary-in-/bin + (lambda _ + (delete-file "fail2ban/setup.py") + (substitute* '("bin/fail2ban-testcases" "setup.py") + ((".*updatePyExec.*") + "")))) + (add-after 'unpack 'patch-setup.py + (lambda _ + ;; Get rid of absolute file names. + (substitute* "setup.py" + (("/etc/fail2ban") + "etc/fail2ban") + (("/var/lib/fail2ban") + "var/lib/fail2ban") + (("\"/usr/bin/\"") + "\"usr/bin/\"") + (("\"/usr/lib/fail2ban/\"") + "\"usr/lib/fail2ban/\"") + (("'/usr/share/doc/fail2ban'") + "'usr/share/doc/fail2ban'")))) + (add-after 'unpack 'disable-some-tests + (lambda _ + (define (make-suite str) + (string-append "tests.addTest\\(loadTests\\(" str "\\)\\)")) + ;; disable tests performing unacceptable side-effects + (substitute* "fail2ban/tests/utils.py" + (((make-suite "actiontestcase.CommandActionTest")) + "") + (((make-suite "misctestcase.SetupTest")) + "") + (((make-suite "filtertestcase.DNSUtilsNetworkTests")) + "") + (((make-suite "filtertestcase.IgnoreIPDNS")) + "") + (((make-suite "filtertestcase.GetFailures")) + "") + (((make-suite "fail2banclienttestcase.Fail2banServerTest")) + "") + (((make-suite "servertestcase.ServerConfigReaderTests")) + "")))) + (add-before 'build 'fix-default-config + (lambda* (#:key outputs #:allow-other-keys) + (substitute* '("config/paths-common.conf" + "fail2ban/tests/utils.py" + "fail2ban/client/configreader.py" + "fail2ban/client/fail2bancmdline.py" + "fail2ban/client/fail2banregex.py") + (("/etc/fail2ban") + (string-append (assoc-ref outputs "out") "/etc/fail2ban"))))) + (add-after 'fix-default-config 'set-action-dependencies + (lambda* (#:key inputs #:allow-other-keys) + ;; deleting things that are not feasible to fix + ;; or won't be used any way + (with-directory-excursion "config/action.d" + (for-each delete-file + '("apf.conf" "bsd-ipfw.conf" + "dshield.conf" + "ipfilter.conf" + "ipfw.conf" + "firewallcmd-allports.conf" + "firewallcmd-common.conf" + "firewallcmd-ipset.conf" + "firewallcmd-multiport.conf" + "firewallcmd-new.conf" + "firewallcmd-rich-logging.conf" + "firewallcmd-rich-rules.conf" + "osx-afctl.conf" + "osx-ipfw.conf" + "pf.conf" + "nginx-block-map.conf" + "npf.conf" + "shorewall.conf" + "shorewall-ipset-proto6.conf" + "ufw.conf"))) + (let* ((lookup-cmd (lambda (i) + (search-input-file inputs i))) + (bin (lambda (i) + (lookup-cmd (string-append "/bin/" i)))) + (sbin (lambda (i) + (lookup-cmd (string-append "/sbin/" i)))) + (ip (sbin "ip")) + (sendmail (sbin "sendmail"))) + (substitute* (find-files "config/action.d" "\\.conf$") + ;; TODO: deal with geoiplookup .. + (("(awk|curl|dig|jq)" all cmd) + (bin cmd)) + (("(cat|echo|grep|head|printf|wc) " all cmd) + (string-append (bin cmd) " ")) + ((" (date|rm|sed|tail|touch|tr) " all cmd) + (string-append " " + (bin cmd) " ")) + (("cut -d") + (string-append (bin "cut") " -d")) + (("`date`") + (string-append "`" + (bin "date") "`")) + (("id -") + (string-append (bin "id") " -")) + (("ip -([46]) addr" all ver) + (string-append ip " -" ver " addr")) + (("ip route") + (string-append ip " route")) + (("ipset ") + (string-append (sbin "ipset") " ")) + (("(iptables|ip6tables) <" all cmd) + (string-append (sbin cmd) " <")) + (("/usr/bin/nsupdate") + (bin "nsupdate")) + (("mail -E") + (string-append sendmail " -E")) + (("nftables = nft") + (string-append "nftables = " + (sbin "nft"))) + (("perl -e") + (string-append (bin "perl") " -e")) + (("/usr/sbin/sendmail") + sendmail) + (("test -e") + (string-append (bin "test") " -e")) + (("_whois = whois") + (string-append "_whois = " + (bin "whois"))))) + (substitute* "config/jail.conf" + (("before = paths-debian\\.conf") + "before = paths-guix.conf")))) + (add-after 'install 'copy-man-pages + (lambda* (#:key outputs #:allow-other-keys) + (let* ((man (string-append (assoc-ref outputs "out") "/man")) + (install-man (lambda (m) + (lambda (f) + (install-file (string-append f "." m) + (string-append man "/man" + m))))) + (install-man1 (install-man "1")) + (install-man5 (install-man "5"))) + (with-directory-excursion "man" + (for-each install-man1 + '("fail2ban" "fail2ban-client" "fail2ban-python" + "fail2ban-regex" "fail2ban-server" + "fail2ban-testcases")) + (for-each install-man5 + '("jail.conf"))))))))) + (native-inputs (list python-setuptools python-wheel)) (inputs (list gawk coreutils-minimal curl From patchwork Sun May 4 08:56:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 42281 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3394927BC4A; Sun, 4 May 2025 09:59:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C39C327BC49 for ; Sun, 4 May 2025 09:59:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBVC2-0001pm-Rs; Sun, 04 May 2025 04:59:26 -0400 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 1uBVBy-0001ok-5x for guix-patches@gnu.org; Sun, 04 May 2025 04:59:22 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBVBf-000456-OL for guix-patches@gnu.org; Sun, 04 May 2025 04:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=fiyNp+kFwllwhr97cTlN/uwnxKmABGYRh54v6E+Qa/I=; b=pcAXYnsg9NsbcWT6g90et+HLDDPXd/ZnGp7TN6QDSsgEWAzNxyQl+tJZEt3Oco+hmtDSiyl01DSrasyKS4qQImlzlIxDn9kNfdnZnYdwTYIYbeRqWrssUd0BB3tiWWJbWc/pjVnP1i03DKyeVUAjjs35mXnPtR2rbQh53ClkeQ11FOseCNT8mM7hOtrI02TkhUn56pOjRL5TlwxPvibnUvUmPcDX6ZVJuYLGFKVrtNPiRF2EgY/AnYJSna+PRksS6s3Bh7jfEjrnDCsipzCkpa7UstyTmV48ShLKyFl6f8DJRR1sHHaAydeONqnsWwuT8CukGYvRAP2XVQYeU6FI+w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBVBf-0000Wc-Ji for guix-patches@gnu.org; Sun, 04 May 2025 04:59:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78066] [PATCH v3 5/6] gnu: fail2ban: Improve style. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 May 2025 08:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78066@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78066-submit@debbugs.gnu.org id=B78066.17463490941620 (code B ref 78066); Sun, 04 May 2025 08:59:03 +0000 Received: (at 78066) by debbugs.gnu.org; 4 May 2025 08:58:14 +0000 Received: from localhost ([127.0.0.1]:51338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBVAr-0000Py-IP for submit@debbugs.gnu.org; Sun, 04 May 2025 04:58:14 -0400 Received: from 9.mo562.mail-out.ovh.net ([46.105.72.114]:45797) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBVAa-0000M7-7X for 78066@debbugs.gnu.org; Sun, 04 May 2025 04:57:59 -0400 Received: from director4.derp.mail-out.ovh.net (director4.derp.mail-out.ovh.net [79.137.60.37]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz826mTfz1W1v; Sun, 4 May 2025 08:57:54 +0000 (UTC) Received: from director4.derp.mail-out.ovh.net (director4.derp.mail-out.ovh.net. [127.0.0.1]) by director4.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78066@debbugs.gnu.org>; Sun, 4 May 2025 08:57:54 +0000 (UTC) Received: from mta7.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.108.2.71]) by director4.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz825dLVz2c5j; Sun, 4 May 2025 08:57:54 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.6]) by mta7.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id 7DCE4C3AB1; Sun, 4 May 2025 08:57:54 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-99G003f7fe9720-8e5f-4c4d-933b-9627259a9705, 8CD8A0E5D230CF78A323F194FBE8D47D3072D94D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 4 May 2025 10:56:25 +0200 Message-ID: <20250504085747.6387-6-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250504085747.6387-1-ngraves@ngraves.fr> References: <20250504085747.6387-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3175600688989135586 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeejjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnheptdejjedvkedtkeekfeehvdejteegvefgveelgfehhfdvjeelffdtteefudetieffnecuffhomhgrihhnpehfrghilhdvsggrnhhrvghgvgigrdhphienucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeektdeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpoffvtefjohhsthepmhhoheeivdgmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=fiyNp+kFwllwhr97cTlN/uwnxKmABGYRh54v6E+Qa/I=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1746349075; v=1; b=WdEXYc+RDUK5174tXdSonaVQ5ROQVFQQgoVxIS0mY8X5DCII5+2QDcM4uDTf8/dm1Jv4Wx96 +Z8ywdFjTKrE9bkPSjAvpv/gNIchyYp6YnEAsmZWrZQqq5dE5WotcuuObzj0lWr6Qg29IT3RKKj smlPUlXCgic89l1D9enuZNfVvFdsok/IGTKPyo90rmmeFSuJg7oexsmxOgjOBQsdFJJYaKu/qwX Z4cUisDA57Dn6Jbz48J9SrTtSTJiPy1wmGouWh6yXsc2QfbWyslnvjxBNe2G4XbIv/8eXJg16it 2k2YFA3x/a0R7Xz4QWEelTz/J1BzrtN01rKmbsrH0/hHA== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (fail2ban): [arguments]: Rewrite phases 'set-action-dependencies and copy-man-pages for readability. --- gnu/packages/admin.scm | 121 ++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 67 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index c9dd154313..e508340ef0 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -6237,21 +6237,22 @@ (define (make-suite str) (((make-suite "servertestcase.ServerConfigReaderTests")) "")))) (add-before 'build 'fix-default-config - (lambda* (#:key outputs #:allow-other-keys) + (lambda _ (substitute* '("config/paths-common.conf" "fail2ban/tests/utils.py" "fail2ban/client/configreader.py" "fail2ban/client/fail2bancmdline.py" "fail2ban/client/fail2banregex.py") (("/etc/fail2ban") - (string-append (assoc-ref outputs "out") "/etc/fail2ban"))))) + (string-append #$output "/etc/fail2ban"))))) (add-after 'fix-default-config 'set-action-dependencies (lambda* (#:key inputs #:allow-other-keys) ;; deleting things that are not feasible to fix ;; or won't be used any way (with-directory-excursion "config/action.d" (for-each delete-file - '("apf.conf" "bsd-ipfw.conf" + '("apf.conf" + "bsd-ipfw.conf" "dshield.conf" "ipfilter.conf" "ipfw.conf" @@ -6270,74 +6271,60 @@ (define (make-suite str) "shorewall.conf" "shorewall-ipset-proto6.conf" "ufw.conf"))) - (let* ((lookup-cmd (lambda (i) - (search-input-file inputs i))) - (bin (lambda (i) - (lookup-cmd (string-append "/bin/" i)))) - (sbin (lambda (i) - (lookup-cmd (string-append "/sbin/" i)))) - (ip (sbin "ip")) - (sendmail (sbin "sendmail"))) - (substitute* (find-files "config/action.d" "\\.conf$") - ;; TODO: deal with geoiplookup .. - (("(awk|curl|dig|jq)" all cmd) - (bin cmd)) - (("(cat|echo|grep|head|printf|wc) " all cmd) - (string-append (bin cmd) " ")) - ((" (date|rm|sed|tail|touch|tr) " all cmd) - (string-append " " - (bin cmd) " ")) - (("cut -d") - (string-append (bin "cut") " -d")) - (("`date`") - (string-append "`" - (bin "date") "`")) - (("id -") - (string-append (bin "id") " -")) - (("ip -([46]) addr" all ver) - (string-append ip " -" ver " addr")) - (("ip route") - (string-append ip " route")) - (("ipset ") - (string-append (sbin "ipset") " ")) - (("(iptables|ip6tables) <" all cmd) - (string-append (sbin cmd) " <")) - (("/usr/bin/nsupdate") - (bin "nsupdate")) - (("mail -E") - (string-append sendmail " -E")) - (("nftables = nft") - (string-append "nftables = " - (sbin "nft"))) - (("perl -e") - (string-append (bin "perl") " -e")) - (("/usr/sbin/sendmail") - sendmail) - (("test -e") - (string-append (bin "test") " -e")) - (("_whois = whois") - (string-append "_whois = " - (bin "whois"))))) + (define (lookup dir file) + (search-input-file inputs (string-append "/" dir "/" file))) + + (substitute* (find-files "config/action.d" "\\.conf$") + ;; TODO: deal with geoiplookup .. + (("(awk|curl|dig|jq)" all cmd) + (lookup "bin" cmd)) + (("(cat|echo|grep|head|printf|wc) " all cmd) + (string-append (lookup "bin" cmd) " ")) + ((" (date|rm|sed|tail|touch|tr) " all cmd) + (string-append " " (lookup "bin" cmd) " ")) + (("cut -d") + (string-append (lookup "bin" "cut") " -d")) + (("`date`") + (string-append "`" (lookup "bin" "date") "`")) + (("id -") + (string-append (lookup "bin" "id") " -")) + (("ip (route|-[46] addr)" all rest) + (string-append (lookup "sbin" "ip") rest)) + (("ipset ") + (string-append (lookup "sbin" "ipset") " ")) + (("(iptables|ip6tables) <" all cmd) + (string-append (lookup "sbin" cmd) " <")) + (("/usr/bin/nsupdate") + (lookup "bin" "nsupdate")) + (("mail -E") + (string-append (lookup "sbin" "sendmail") " -E")) + (("nftables = nft") + (string-append "nftables = " (lookup "sbin" "nft"))) + (("perl -e") + (string-append (lookup "bin" "perl") " -e")) + (("/usr/sbin/sendmail") + (lookup "sbin" "sendmail")) + (("test -e") + (string-append (lookup "bin" "test") " -e")) + (("_whois = whois") + (string-append "_whois = " (lookup "bin" "whois")))) + (substitute* "config/jail.conf" (("before = paths-debian\\.conf") "before = paths-guix.conf")))) (add-after 'install 'copy-man-pages - (lambda* (#:key outputs #:allow-other-keys) - (let* ((man (string-append (assoc-ref outputs "out") "/man")) - (install-man (lambda (m) - (lambda (f) - (install-file (string-append f "." m) - (string-append man "/man" - m))))) - (install-man1 (install-man "1")) - (install-man5 (install-man "5"))) - (with-directory-excursion "man" - (for-each install-man1 - '("fail2ban" "fail2ban-client" "fail2ban-python" - "fail2ban-regex" "fail2ban-server" - "fail2ban-testcases")) - (for-each install-man5 - '("jail.conf"))))))))) + (lambda _ + (define (install-man m) + (lambda (f) + (install-file (string-append f "." m) + (string-append #$output "man/man" m)))) + + (with-directory-excursion "man" + (for-each (install-man "1") + '("fail2ban" "fail2ban-client" "fail2ban-python" + "fail2ban-regex" "fail2ban-server" + "fail2ban-testcases")) + ((install-man "5") "jail.conf"))))))) (native-inputs (list python-setuptools python-wheel)) (inputs (list gawk coreutils-minimal From patchwork Sun May 4 08:56:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 42282 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7C82B27BC4B; Sun, 4 May 2025 09:59:45 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EF7D827BC49 for ; Sun, 4 May 2025 09:59:44 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uBVC4-0001qd-0I; Sun, 04 May 2025 04:59:28 -0400 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 1uBVBy-0001oo-9R for guix-patches@gnu.org; Sun, 04 May 2025 04:59:24 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uBVBe-000452-QR for guix-patches@gnu.org; Sun, 04 May 2025 04:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=tQ/tOhN/wClrGCdKG1t9s/+iJqK8uhQlqh+alDlBk+M=; b=mb6/RjGb4uUeJyhdZAP1XHHyTHa7j5W/pXSXB+biHo16hLApSMKsuX+sVKnshuQyPSjlMKtsTxp+mxLVP0B4kli6oL62rN/16G4KQpFZImT2OW4O/IbzGRJQGSHpXe642+jtzhw2FST8l1qgOr9EiWkzWQ/o+jHXFBLooL9oeWoc0gSou8X4ahp7JrGjQO2pPI7a7Edy3sTBIm3vOW4z/ijpR2lqKNn1+cvaMXi+pghQLFYpKVSWMkjdB9pVYh5qFyTrBOTzSZ24yoSDFy0uuHD+vSOxUsYMSlAojDEcwHvyA+DTfWVQ1N3arp5+G1BN6+qNoFX6xQimnil0Q4A7YQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uBVBe-0000WN-KH for guix-patches@gnu.org; Sun, 04 May 2025 04:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78066] [PATCH v3 6/6] gnu: fail2ban: Improve snippet. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 May 2025 08:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78066@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78066-submit@debbugs.gnu.org id=B78066.17463490921604 (code B ref 78066); Sun, 04 May 2025 08:59:02 +0000 Received: (at 78066) by debbugs.gnu.org; 4 May 2025 08:58:12 +0000 Received: from localhost ([127.0.0.1]:51334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uBVAp-0000Pm-PP for submit@debbugs.gnu.org; Sun, 04 May 2025 04:58:12 -0400 Received: from 9.mo562.mail-out.ovh.net ([46.105.72.114]:43265) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uBVAa-0000MB-Vl for 78066@debbugs.gnu.org; Sun, 04 May 2025 04:57:58 -0400 Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net [152.228.215.222]) by mo562.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz840zP4z1W2l; Sun, 4 May 2025 08:57:56 +0000 (UTC) Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net. [127.0.0.1]) by director3.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78066@debbugs.gnu.org>; Sun, 4 May 2025 08:57:55 +0000 (UTC) Received: from mta7.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.109.139.55]) by director3.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4Zqz836fsfz61lp; Sun, 4 May 2025 08:57:55 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.3]) by mta7.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id 694E3C3AB1; Sun, 4 May 2025 08:57:55 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-95G00182190a72-a616-4d4f-9ef3-dd899533d690, 8CD8A0E5D230CF78A323F194FBE8D47D3072D94D) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Sun, 4 May 2025 10:56:26 +0200 Message-ID: <20250504085747.6387-7-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250504085747.6387-1-ngraves@ngraves.fr> References: <20250504085747.6387-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3175882162924544738 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvjeejjeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdeltddrledvrdduudejrddugeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejkedtieeiseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdfovfetjfhoshhtpehmohehiedvmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=tQ/tOhN/wClrGCdKG1t9s/+iJqK8uhQlqh+alDlBk+M=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1746349076; v=1; b=j1/DFSQI5mav+nYZVgSp8RE81vFGnNomUYtd2dxSwnhDJhvTcq/LiA05mrL9BTe533hOl7oF VDxRxfU/0Jh0wGtxPDnU2bHo5dugsEFH1gkc93A5SvQYL/S8Af1K70Jo/0n3n1HmByk9twWbBnU KIgiiuflMU2AlEwQefIc2ufJhyRja2m83nSIsnn89Pohbdv++S+ESS1Jc8Sx/7sJaV+BHflyJrQ SQ6LXontGC7sFCl2z4IWErsYKhm+16FBB01KPTMiPdQjZCIvyLXI5Jk19M+t83tdlGpuwSEiZTw 5SNomEu/bwZSizjQSMMAMkhE20+xZ2yjClCDqlw3VcEeA== 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (fail2ban) [source]: Remove (srfi srfi-26). : Use gexp. Move substitute* patches... [arguments]: ...to phases 'patch-setup.py and 'disable-some-tests. --- gnu/packages/admin.scm | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index e508340ef0..8fee710c7f 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -6218,23 +6218,19 @@ (define-public fail2ban "'usr/share/doc/fail2ban'")))) (add-after 'unpack 'disable-some-tests (lambda _ - (define (make-suite str) - (string-append "tests.addTest\\(loadTests\\(" str "\\)\\)")) + (define (make-suite-regex tests) + (string-append "tests.addTest\\(loadTests\\((" + (string-join tests "|") + ")\\)\\)")) ;; disable tests performing unacceptable side-effects (substitute* "fail2ban/tests/utils.py" - (((make-suite "actiontestcase.CommandActionTest")) - "") - (((make-suite "misctestcase.SetupTest")) - "") - (((make-suite "filtertestcase.DNSUtilsNetworkTests")) - "") - (((make-suite "filtertestcase.IgnoreIPDNS")) - "") - (((make-suite "filtertestcase.GetFailures")) - "") - (((make-suite "fail2banclienttestcase.Fail2banServerTest")) - "") - (((make-suite "servertestcase.ServerConfigReaderTests")) + (((make-suite-regex (list "actiontestcase.CommandActionTest" + "misctestcase.SetupTest" + "filtertestcase.DNSUtilsNetworkTests" + "filtertestcase.IgnoreIPDNS" + "filtertestcase.GetFailures" + "fail2banclienttestcase.Fail2banServerTest" + "servertestcase.ServerConfigReaderTests"))) "")))) (add-before 'build 'fix-default-config (lambda _