(WIP) Eat payload of UnrealIRCd channel mode +f #1752
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 lIt 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:
After: