X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/38cbb0a259f5710fe2bf0b14379474988db21630..40c1fd479952f47b9f3f5c4de660cd94ddd1a89a:/modules/m_pass.c diff --git a/modules/m_pass.c b/modules/m_pass.c index 6ef11a8e..0cc0747b 100644 --- a/modules/m_pass.c +++ b/modules/m_pass.c @@ -26,7 +26,7 @@ #include "stdinc.h" #include "client.h" /* client struct */ -#include "irc_string.h" +#include "match.h" #include "send.h" /* sendto_one */ #include "numeric.h" /* ERR_xxx */ #include "ircd.h" /* me */ @@ -60,6 +60,9 @@ DECLARE_MODULE_AV1(pass, NULL, NULL, pass_clist, NULL, NULL, "$Revision: 3550 $" static int mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { + char *auth_user, *pass, *buf; + buf = LOCAL_COPY(parv[1]); + if(client_p->localClient->passwd) { memset(client_p->localClient->passwd, 0, @@ -68,6 +71,22 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char * } client_p->localClient->passwd = rb_strndup(parv[1], PASSWDLEN); + + if ((pass = strchr(buf, ':')) != NULL) + { + *pass++ = '\0'; + auth_user = buf; + } + else + { + pass = buf; + auth_user = NULL; + } + + client_p->localClient->passwd = rb_strndup(pass, PASSWDLEN); + + if(auth_user) + client_p->localClient->auth_user = rb_strndup(auth_user, PASSWDLEN); /* These are for servers only */ if(parc > 2 && client_p->user == NULL)