diff --git a/src/modules/m_sapart.c b/src/modules/m_sapart.c index 545a14e7c..8e0d6873b 100644 --- a/src/modules/m_sapart.c +++ b/src/modules/m_sapart.c @@ -92,24 +92,25 @@ DLLFUNC CMD_FUNC(m_sapart) char commentx[512]; char jbuf[BUFSIZE]; - if (!IsSAdmin(sptr) && !IsULine(sptr)) + if (parc < 3) + { + sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "SAPART"); + return 0; + } + + if (!(acptr = find_person(parv[1], NULL))) + { + sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]); + return 0; + } + + /* See if we can operate on this vicim/this command */ + if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"sapart",sptr,acptr,NULL,NULL)) { sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); return 0; } - if (parc < 3) - { - sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "SAPART"); - return 0; - } - - if (!(acptr = find_person(parv[1], NULL))) - { - sendto_one(sptr, err_str(ERR_NOSUCHNICK), me.name, parv[0], parv[1]); - return 0; - } - if (MyClient(acptr)) { /* Now works like m_join */ @@ -124,6 +125,14 @@ DLLFUNC CMD_FUNC(m_sapart) name); continue; } + + /* Validate oper can do this on chan/victim */ + if (!IsSAdmin(sptr) && !IsULine(sptr) && !OperClass_evaluateACLPath(sptr->user->operlogin,"sapart",sptr,acptr,chptr,NULL)) + { + sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); + continue; + } + if (!(lp = find_membership_link(acptr->user->channel, chptr))) { sendto_one(sptr, err_str(ERR_USERNOTINCHANNEL), me.name, parv[0],