emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57473: closed ([PATCH] gnu: fail2ban-service-type: Fix field name se


From: GNU bug Tracking System
Subject: bug#57473: closed ([PATCH] gnu: fail2ban-service-type: Fix field name serialization.)
Date: Thu, 01 Sep 2022 13:04:01 +0000

Your message dated Thu, 01 Sep 2022 09:03:43 -0400
with message-id <875yi79rgw.fsf@gmail.com>
and subject line Re: [PATCH v2 3/4] gnu: fail2ban-service-type: Fix type of 
enabled? field.
has caused the debbugs.gnu.org bug report #57473,
regarding [PATCH] gnu: fail2ban-service-type: Fix field name serialization.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
57473: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57473
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] gnu: fail2ban-service-type: Fix field name serialization. Date: Mon, 29 Aug 2022 12:42:05 +0300
* gnu/services/security.scm: Wrong condition in string-filter
function in fail2ban-jail-configuration-serialize-field-name.
---
 gnu/services/security.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/services/security.scm b/gnu/services/security.scm
index 1e0360c07f..9ab23ffb46 100644
--- a/gnu/services/security.scm
+++ b/gnu/services/security.scm
@@ -127,7 +127,7 @@ (define (fail2ban-jail-configuration-serialize-field-name 
name)
           (string-append "bantime." (substring name 9))))
         ((string-contains name "-")
          (fail2ban-jail-configuration-serialize-field-name
-          (string-filter (lambda (c) (equal? c #\-)) name)))
+          (string-filter (lambda (c) (not (equal? c #\-))) name)))
         (else name)))
 
 (define (fail2ban-jail-configuration-serialize-string field-name value)
-- 
2.37.2




--- End Message ---
--- Begin Message --- Subject: Re: [PATCH v2 3/4] gnu: fail2ban-service-type: Fix type of enabled? field. Date: Thu, 01 Sep 2022 09:03:43 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
Hi muradm,

muradm <mail@muradm.net> writes:

> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> Hi,
>>
>> muradm <mail@muradm.net> writes:
>>
>>> * gnu/services/security.scm (fail2ban-jail-configuration)
>>> [enabled?]: Should be maybe-boolean, which is how normaly fail2ban
>>> is configured. This also allows sections without enabled field
>>> like @samp{[DEFAULT]}.
>>> * doc/guix.texi: Type of enabled? is maybe-boolean.
>>> ---
>
> [...]
>
>>> @@ -197,7 +197,7 @@ (define-configuration
>>> fail2ban-jail-configuration
>>>     "Required name of this jail configuration."
>>>     empty-serializer)
>>>    (enabled?
>>> -   (boolean #t)
>>> +   maybe-boolean
>>
>> I made this change willingly, because it doesn't make sense to me to
>> define a jail configuration that is disabled by default.
>>
>> Does that make sense?
>
> When I was implementing configuration, I was thinking the same.
>
> However, while trying to find sensible or hardcoded defaults,
> looking at code and usage examples, I found that configuration
> of fail2ban is quite loose, than one can anticipiate. Variables
> can be overriden from many places, so absence of variable also
> becomes as important. So I decided to opt-in for most fields
> as maybe-.
>
> IMHO, this is why they had to make --d/--dp flags to
> dump effective configuration :)
>
> I actually mention that in the docs, where it says that
> unspecified values are not serialized in favor of whatever
> are defaults and/or values specified elsewhere. Which are
> basically hard to track.

I had looked at how this all works, and while it's true that omitting
values seems the norm, in the context of Guix, it seems OK diverge for
this for the 'enabled' value of extra jail configurations (jail.local).

> And finally there is a [DEFAULT] section which applies to all
> jails. But it is not a jail by itself. So if there is "enabled =
> false" or "enabled = true", fail2ban fails to start, because of
> unexpected variable for that section.

You mean the default section from $(guix build
fail2ban)/etc/fail2ban/jail.conf?  It has 'enabled = false', and we
don't generate such section ourselves, so I don't understand your point.
The test suite also passes; can you think of a scenario that would make
it fail?  We could add a test for it.

I've pushed the other corrections, thanks!

Closing (but we can continue the discussion here).

Maxim


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]