View Issue Details

IDProjectCategoryView StatusLast Update
0006511unrealircdpublic2025-12-17 17:30
Reporterarmyn Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version6.1.9.1 
Summary0006511: accidental permanent gline even though default-bantime is 7d
DescriptionI noticed that a colleague from IRCop sometimes bans users with the following command:
/gline *@2a02:1808:* Dehors !
but forgets to add the ":" before the reason. As a result, the ban duration is set to 'permanent.' He doesn’t correct it. Is there a way to block this, prevent the permanent bans, or make the permanent ban expire after 7 days? Or perhaps in UnrealIRCd, is there a place where I can change the default '0' or 'permanent' to something like '7d' ?
3rd party modules

Activities

PeGaSuS

2025-05-08 12:04

reporter   ~0023444

Hi.

As you may have noticed, this is a bug tracker, used to bug reports or feature requests and should not be used as a mean to get help/support.

The preferred methods to get help, are the following:

    1) IRC

    2) Forum - https://forums.unrealircd.org/

We suggest using IRC first.

Now, to answer your question:

    The `:` isn't really needed in the ban reason and that wouldn't change the ban time.

    You can use the set::default-bantime (https://www.unrealircd.org/docs/Set_block#set::default-bantime) to specify something like
set {
    default-bantime 7d;
}


Hope this helps and I'm sorry if I sounded harsh at the beginning but some issues (like this one and other already closed) could have been discussed on IRC first.

armyn

2025-05-08 18:02

reporter   ~0023445

The "default-bantime" has already been set for several years, it's set to 1 day. The default gline is still 'permanent'. If we don't put a colon (:) before the reason and it contains more than two words, it won't work correctly.

armyn

2025-05-08 18:08

reporter   ~0023446

You can test it:
/gline *@11.22.33.44 Dehors !

you'll see this:
 tkl.TKL_ADD [info] G-Line added: '*@11.22.33.44' [reason: Dehors !] [by: ...] [duration: permanent]

However, I don't understand why it doesn't work with this ban reason:
/gline *@11.22.33.44 test1 test2
tkl.TKL_ADD [info] G-Line added: '*@11.22.33.44' [reason: test2] [by: ...] [duration: 1s]

armyn

2025-05-08 18:11

reporter   ~0023447

It seems like it's because the ban reason starts with "de"

zw32h

2025-12-17 17:30

reporter   ~0023584

The statement “the : isn’t needed and wouldn’t change the ban time” is incorrect.

In src/modules/tkl.c, the /GLINE handler expects parameters as:
parv[1] = mask
parv[2] = duration
parv[3] = reason

If a second parameter exists, it is always treated as a user-supplied duration.
In the TKL code, an expiration value of 0 means permanent.

Example:

/gline *@11.22.33.44 Dehors !

Here, “Dehors” is parsed as parv[2] (duration). It does not parse as a valid time, resolves to 0, and is therefore stored as permanent. Since a duration parameter was present, default-bantime is not applied.

With:

/gline *@11.22.33.44 :Dehors !

there is no duration parameter, so UnrealIRCd falls back to default-bantime.

The “test1 test2” case results in 1s because the time parser extracts the digit (1) from “test1”, not because of the word itself.

This behaviour is consistent with the current source code and explains the accidental permanent GLINEs.

Issue History

Date Modified Username Field Change
2025-05-08 05:21 armyn New Issue
2025-05-08 12:04 PeGaSuS Note Added: 0023444
2025-05-08 18:02 armyn Note Added: 0023445
2025-05-08 18:08 armyn Note Added: 0023446
2025-05-08 18:11 armyn Note Added: 0023447
2025-07-31 15:47 syzop Description Updated
2025-07-31 15:49 syzop Summary Managing Automatic Ban Durations in IRC (Gline...) => accidental permanent gline even though default-bantime is 7d
2025-12-17 17:30 zw32h Note Added: 0023584