]> PatchyGit - patchyircd.git/commitdiff
allow AUTHENTICATE after registration
authorEgor <egor@patchysicp.xyz>
Thu, 25 Jan 2024 11:32:07 +0000 (13:32 +0200)
committerEgor <egor@patchysicp.xyz>
Thu, 25 Jan 2024 11:32:07 +0000 (13:32 +0200)
why are so many clients so stupid?

also don't leak the saslbuf

src/irc.c
src/net.c

index acf46a2..0acedf5 100644 (file)
--- a/src/irc.c
+++ b/src/irc.c
@@ -268,8 +268,6 @@ int processPacket(struct client_data *client, char *source, char *command, int a
                        goto unknown;
                }
        } else if(strcmp(command, "AUTHENTICATE") == 0) {
-               if (is_registered(client))
-                       return err_alreadyregistered(client), sendbuf(client), 0;
                if (!args[0])
                        return err_needmoreparams(client, command), sendbuf(client), 0;
                if (client->username && client->username[0] != '~')
index 7d471d9..10d42bd 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -136,6 +136,9 @@ void killConnectionPart2(struct client_data *cl)
                memset(cl->pass_reg, 0, strlen(cl->pass_reg));
        free(cl->pass_reg);
        free(cl->peername);
+       if (cl->saslbuf)
+               memset(cl->saslbuf, 0, 1024);
+       free(cl->saslbuf);
        free(cl);
 }