From d5d52a994dec812d23f74c9b1bd0f4e922ec4bfe Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Wed, 15 Aug 2018 22:44:02 +0100 Subject: [PATCH] m_nick/m_sasl/m_user: restore check for mixing of client and server protocol --- modules/core/m_nick.c | 2 +- modules/m_sasl.c | 2 +- modules/m_user.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c index 0b2481e4..09d34df8 100644 --- a/modules/core/m_nick.c +++ b/modules/core/m_nick.c @@ -122,7 +122,7 @@ mr_nick(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_ struct Client *target_p; char nick[NICKLEN]; - if (strlen(client_p->id) == 3) + if (strlen(client_p->id) == 3 || (source_p->preClient && !EmptyString(source_p->preClient->id))) { exit_client(client_p, client_p, client_p, "Mixing client and server protocol"); return; diff --git a/modules/m_sasl.c b/modules/m_sasl.c index 284e4c93..c76d6aab 100644 --- a/modules/m_sasl.c +++ b/modules/m_sasl.c @@ -146,7 +146,7 @@ m_authenticate(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client * return; } - if(strlen(client_p->id) == 3) + if (strlen(client_p->id) == 3 || (source_p->preClient && !EmptyString(source_p->preClient->id))) { exit_client(client_p, client_p, client_p, "Mixing client and server protocol"); return; diff --git a/modules/m_user.c b/modules/m_user.c index d0360039..fc657c9b 100644 --- a/modules/m_user.c +++ b/modules/m_user.c @@ -63,7 +63,7 @@ mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_ static char buf[BUFSIZE]; char *p; - if (strlen(client_p->id) == 3) + if (strlen(client_p->id) == 3 || (source_p->preClient && !EmptyString(source_p->preClient->id))) { exit_client(client_p, client_p, client_p, "Mixing client and server protocol"); return;