Skip to content

add space to output of "fail2ban-client get dbpurgeage"#4012

Open
leggewie wants to merge 1 commit into
fail2ban:masterfrom
leggewie:master
Open

add space to output of "fail2ban-client get dbpurgeage"#4012
leggewie wants to merge 1 commit into
fail2ban:masterfrom
leggewie:master

Conversation

@leggewie

@leggewie leggewie commented Jun 1, 2025

Copy link
Copy Markdown

When running fail2ban-client get dbpurgeage, I noticed there is no space between the value and the string "dbpurgeage" in the output. This PR fixes that.

BEFORE:

# fail2ban-client get dbpurgeage
Current database purge age is:
`- 86400seconds

AFTER:

# fail2ban-client get dbpurgeage
Current database purge age is:
`- 86400 seconds

While preparing the patch, I noticed the apostrophe ` at the beginning of the line which seems out of place. I noticed its presence in a number of other places in the code, so I wonder if it's intentional. If not, I'd be happy to prepare another PR. Let me know.

@sebres

sebres commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

I noticed there is no space between the value and the string "dbpurgeage" in the output.

Looks intentional to me:

86400seconds is the same than 86400s or 24hours (24h) or 1440min or 1days (or 1d).

See https://manpages.debian.org/bookworm/fail2ban/jail.conf.5.en.html#TIME_ABBREVIATION_FORMAT

While preparing the patch, I noticed the apostrophe ` at the beginning of the line which seems out of place.

It is also intentional (historic), in this way it would show fail2ban (and its tools) output several blocks:

Results
=======

Prefregex: 1 total
|  ...
`-

Failregex: 1 total
|-  #) [# of hits] regular expression
|  23) [1] ...
`-

Date template hits:
|- [# of hits] date format
|  [1] {^LN-BEG}Day(?P<_sep>[-/])Month(?P=_sep)(?:ExYear|ExYear2) %k:Minute:Second
`-

However questionable and maybe doesn't make sense for single parameter.

But because it is historic (and can be parsed by some tools or user-side scripts), I don't think it is good idea to change the behavior of beautifier output. At least not before next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants