From the spec:
If the client completes registration (with CAP END, NICK, USER and any
other necessary messages) while the SASL authentication is still in
progress, the server SHOULD abort it and send a 906 numeric, then
register the client without authentication.
free(client->saslbuf);
client->saslbuf = 0;
client->saslbufLen = 0;
- newUser(client);
return 0;
}
}
}
void newUser(struct client_data *client) {
- if (client->regstate == REG_CAPLS || client->saslbuf || !client->nick_reg || !client->username)
+ if (client->regstate == REG_CAPLS || !client->nick_reg || !client->username)
return;
+ if (client->saslbuf) {
+ copy_strf(&databuf, ":%s 906 * :SASL auhtentication aborted\r\n", hostname), sendbuf(client);
+ memset(client->saslbuf, 0, 1024);
+ free(client->saslbuf);
+ client->saslbuf = 0;
+ client->saslbufLen = 0;
+ }
if (client->username[0] == '~' && client->pass_reg) {
int res = password_check(client->username + 1, client->pass_reg, getdatafile("users.txt"));
memset(client->pass_reg, 0, strlen(client->pass_reg));