-
Notifications
You must be signed in to change notification settings - Fork 55
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
Sanitize username early, and early reject invalid ones #434
Conversation
This ensures we don't allow [ in usernames anywhere. This also adds the tilde early, which simplifies a lot of things, and fixes an issue with username K-Lines on IsNoTilde users.
This way invalid characters in usernames only appear in this snote, and all other rejection snotes will always have clean usernames.
beffef4
to
5a98757
Compare
I believe that we need to test that the new |
ircd/s_user.c
Outdated
|
||
myusername[i] = '\0'; | ||
notildeusername[o] = '\0'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could be accomplished by testing if o
is still zero here.
5a98757
to
62e860d
Compare
Fixed by moving the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works in my test instance; format strings seem correct
This ensures [ won't appear in the various rejection snotes, and invalid username characters only appear in the snote announcing their rejection.
Supersedes #433 and #381
Fixes #334