From 449c223d5d7449402ab35e4a4e1c85b38797eec4 Mon Sep 17 00:00:00 2001 From: codemastr Date: Thu, 28 Dec 2000 02:15:45 +0000 Subject: [PATCH] Fixed a serious bug --- Changes | 1 + src/s_serv.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Changes b/Changes index e388a9ce9..34c7a89b9 100644 --- a/Changes +++ b/Changes @@ -61,3 +61,4 @@ - Started work on the except parser - Fixed a STATS_ONLYOPER bug - Fixed a ircd.tune bug (the file may not write if it didn't exist) +- Fixed a serious bug reported by Kanzen_Griever diff --git a/src/s_serv.c b/src/s_serv.c index 99076a0ea..ce687763d 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -597,6 +597,14 @@ int m_server(cptr, sptr, parc, parv) sendto_one(cptr, "ERROR :No servername"); return 0; } + + if (!cptr->passwd) { + sendto_one(cptr, + "ERROR :No Access (passwd mismatch) %s", inpath); + sendto_locfailops("Access denied (passwd mismatch) %s", + inpath); + return exit_client(cptr, cptr, cptr, "Bad Password"); + } if (MyConnect(sptr) && (sptr->acpt->umodes & LISTENER_CLIENTSONLY)) { return exit_client(cptr, sptr, sptr, "This port is for clients only"); @@ -709,6 +717,13 @@ int m_server(cptr, sptr, parc, parv) #else encr = cptr->passwd; #endif /* CRYPT_LINK_PASSWORD */ + if (!encr || !aconf->passwd) { + sendto_one(cptr, + "ERROR :No Access (passwd mismatch) %s", inpath); + sendto_locfailops("Access denied (passwd mismatch) %s", + inpath); + return exit_client(cptr, cptr, cptr, "Bad Password"); + } if (aconf->passwd && encr && *aconf->passwd && !StrEq(aconf->passwd, encr)) { sendto_one(cptr,