From 01aab68a5e0b7a40c49ab91dbaf175181e51e310 Mon Sep 17 00:00:00 2001 From: Egor Date: Fri, 28 Jun 2024 21:57:51 +0300 Subject: [PATCH] wait for SASL password check --- src/irc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/irc.c b/src/irc.c index c4f3337..df370c2 100644 --- a/src/irc.c +++ b/src/irc.c @@ -220,6 +220,7 @@ static void cont_sasl(struct client_data *client, int res) { } free(client->saslusername); client->saslusername = 0; + newUser(client); } } static void cont_pass(struct client_data *client, int res) { @@ -1197,9 +1198,9 @@ unknown: } void newUser(struct client_data *client) { - if (client->regstate == REG_CAPLS || !client->nick_reg || !client->username || client->passwait || client->webircwait) + if (client->regstate != REG_INIT || !client->nick_reg || !client->username || client->passwait || client->webircwait || client->saslusername) return; - if (client->saslbuf || client->saslusername) { + if (client->saslbuf) { copy_strf(&databuf, ":%s 906 * :SASL auhtentication aborted\r\n", hostname), sendbuf(client); if (client->saslbuf) { memset(client->saslbuf, 0, 1024); @@ -1207,10 +1208,6 @@ void newUser(struct client_data *client) { client->saslbuf = 0; client->saslbufLen = 0; } - if (client->saslusername) { - free(client->saslusername); - client->saslusername = 0; - } } if (client->username[0] == '~' && client->pass_reg) { job_password_check(client, client->username+1, client->pass_reg, getdatafile("users.txt"), cont_pass); -- 2.56.0