From 98a793da0131fe80420901b0dd6be874ef40a3a6 Mon Sep 17 00:00:00 2001 From: Holbrook Bunting Date: Sun, 3 Apr 2022 15:31:10 -0700 Subject: [PATCH] Squit Issue 176 Return error now if it's an oper sending the squit command alone, continue to do same if server instead. --- src/s_serv.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/s_serv.c b/src/s_serv.c index 641e419e..bf7f80ac 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -215,11 +215,18 @@ m_squit(aClient *cptr, aClient *sptr, int parc, char *parv[]) } else { - /* This is actually protocol error. But, well, closing the - * link is very proper answer to that... - */ - server = cptr->name; - acptr = cptr; + // Return error if an oper sends '/squit' alone. -Holbrook + if (!IsServer(cptr)) + { + sendto_one(cptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "SQUIT"); + return 0; + } + + else + { + server = cptr->name; + acptr = cptr; + } } if (!acptr)