Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) Eat payload of UnrealIRCd channel mode +f #1752

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

michaelortmann
Copy link
Member

Found by: Lord255
Patch by: michaelortmann
Fixes: #1246

One-line summary:
Eat payload of UnrealIRCd channel mode +f so it does not clobber payloads of +k and / or +l

Additional description (if needed):
When eggdrop parses the channel mode line (numeric 324) it splits it at whitespace. first word is mode chars, next words are payloads.
example: +fl [10j]:15 42" has got 2 payloads, one for f and one for l
It parses the mode chars one by one.
Any unknown mode char is skipped.
Some known modes like +k and +l have payloads.
When eggdrop handles those mode chars, it will eat the next payload.
+f is an unknown mode, so the f char is ignored, so far so good.
But +f also has a payload.
If that payload is not eaten, it would be eaten as the payload for the next known mode char with payload and BOOM!
This PR makes eggdrop eat the +f payload, so that the next known mode with payload will eat the right payload and not the +f payload.

This Issue is also interesting in that it doesnt fail or log an error trying to read an integer payload for +l, when it got a string payload for +f. More reason to not use atoi() and get #1583 fixed.

See also: https://www.unrealircd.org/docs/Channel_anti-flood_settings

Test cases demonstrating functionality (if applicable):
ircII client:
*** Mode for channel #foo is "+fl [10j]:15 42"
UnrealIRCd 6.1.2.3 server:
Before:

[04:51:14] [@] :irc.example.org 324 BotA #foo +fl [10j]:15 42
[...]
.channel
[...]
Channel #foo, 2 members, mode +:

After:

[04:55:26] [@] :irc.example.org 324 BotA #foo +fl [10j]:15 42
[...]
.channel
[...]
Channel #foo, 2 members, mode +l 42:

@michaelortmann
Copy link
Member Author

So far, this PR only fixes got324()

There is probably more to do to fix all +f mode fallout, but its a beginning and can be reviewed merged as is. We can do followup Issues / PRs. The original Issue looks like it describes several different bugs regarding +f.

@michaelortmann
Copy link
Member Author

We could also think about adding full / proper +f support, so the bot can set it, if there is enough interest in such new feature.

@Robby-
Copy link
Contributor

Robby- commented Feb 2, 2025

The proper solution, but is probably much more work, is parsing 005 to get all the modes that have "payloads", because there's a bunch more than just +f. On InspIRCd there's for example also +B, +E, +F, +j and so on, and it also has a +f but with a different payload syntax.

@michaelortmann michaelortmann changed the title Eat payload of UnrealIRCd channel mode +f (WIP) Eat payload of UnrealIRCd channel mode +f Feb 3, 2025
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.

handle extended +f channel mode (unrealircd(!))
2 participants