Open
Conversation
Check for ban after SSL stuff done with, now get KLine/AKill info instead of SSL error instead.
crigler
reviewed
Apr 6, 2022
Comment on lines
-1366
to
-1377
| ban = check_userbanned(acptr, UBAN_IP|UBAN_CIDR4|UBAN_WILDUSER, 0); | ||
| if(ban) | ||
| { | ||
| int loc = (ban->flags & UBAN_LOCAL) ? 1 : 0; | ||
|
|
||
| ircstp->is_ref++; | ||
| ircstp->is_ref_1++; | ||
| exit_banned_client(acptr, loc, loc ? 'K' : 'A', ban->reason, 0); | ||
|
|
||
| return NULL; | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
This looks like check_userbanned will be postponed until SERVER or USER is parsed even for non-SSL connections. Couldn't we just silently return here if it is a banned SSL connection, and add another ban check when the SSL handshake is finished?
Member
Author
There was a problem hiding this comment.
True. By skipping this part, one less look through the banlist for a match, especially if the ban is placed on user@host, as we don't have the user info here yet.
| } | ||
|
|
||
| if(!(ban = check_userbanned(sptr, UBAN_IP|UBAN_CIDR4, UBAN_WILDUSER))) | ||
| if(!(ban = check_userbanned(sptr, UBAN_IP|UBAN_CIDR4, 0))) |
Contributor
There was a problem hiding this comment.
Why is removing UBAN_WILDUSER necessary?
Member
Author
There was a problem hiding this comment.
If you look in check_userbanned, with the flag, during my tests, only bans on *@host instead of both and *user@host are being matched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Check for ban after SSL stuff done with, now get KLine/AKill info instead of SSL error instead.