mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-06 10:13:13 +02:00
Add ACL checks for sapart
This commit is contained in:
+22
-13
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user