Unify oper:{global,local}_kill

This commit is contained in:
Ed Kellett 2020-10-24 23:49:28 +01:00
parent 8a776ce65c
commit 7d84719d68
8 changed files with 18 additions and 29 deletions

View file

@ -236,7 +236,7 @@ auth {
* means they must be defined before operator {}. * means they must be defined before operator {}.
*/ */
privset "local_op" { privset "local_op" {
privs = oper:general, oper:privs, oper:testline, oper:local_kill, oper:operwall, usermode:servnotice, privs = oper:general, oper:privs, oper:testline, oper:kill, oper:operwall, usermode:servnotice,
auspex:oper, auspex:hostname, auspex:umodes, auspex:cmodes; auspex:oper, auspex:hostname, auspex:umodes, auspex:cmodes;
}; };
@ -247,7 +247,7 @@ privset "server_bot" {
privset "global_op" { privset "global_op" {
extends = "local_op"; extends = "local_op";
privs = oper:global_kill, oper:routing, oper:kline, oper:unkline, oper:xline, privs = oper:routing, oper:kline, oper:unkline, oper:xline,
oper:resv, oper:cmodes, oper:mass_notice, oper:remoteban; oper:resv, oper:cmodes, oper:mass_notice, oper:remoteban;
}; };

View file

@ -441,8 +441,7 @@ privset "local_op" {
* auspex:hostname: shows hidden hostnames/ips * auspex:hostname: shows hidden hostnames/ips
* oper:privs: allows /stats o/O and seeing privset in /whois * oper:privs: allows /stats o/O and seeing privset in /whois
* oper:testline: allows /testline and /testgecos * oper:testline: allows /testline and /testgecos
* oper:local_kill: allows local users to be /KILL'd * oper:kill: allows local and remote users to be /KILL'd
* oper:global_kill: allows local and remote users to be /KILL'd
* oper:routing: allows remote SQUIT and CONNECT * oper:routing: allows remote SQUIT and CONNECT
* oper:kline: allows KLINE and DLINE * oper:kline: allows KLINE and DLINE
* oper:unkline: allows UNKLINE and UNDLINE * oper:unkline: allows UNKLINE and UNDLINE
@ -475,7 +474,7 @@ privset "local_op" {
* confers the benefits of chmode +M (operpeace) (from extensions/chm_operpeace) * confers the benefits of chmode +M (operpeace) (from extensions/chm_operpeace)
* usermode:helpops allows setting +H (from extensions/helpops) * usermode:helpops allows setting +H (from extensions/helpops)
*/ */
privs = oper:general, oper:privs, oper:testline, oper:local_kill, oper:operwall, usermode:servnotice, privs = oper:general, oper:privs, oper:testline, oper:kill, oper:operwall, usermode:servnotice,
auspex:oper, auspex:hostname, auspex:umodes, auspex:cmodes; auspex:oper, auspex:hostname, auspex:umodes, auspex:cmodes;
}; };
@ -487,7 +486,7 @@ privset "server_bot" {
privset "global_op" { privset "global_op" {
extends = "local_op"; extends = "local_op";
privs = oper:global_kill, oper:routing, oper:kline, oper:unkline, oper:xline, privs = oper:routing, oper:kline, oper:unkline, oper:xline,
oper:resv, oper:cmodes, oper:mass_notice, oper:remoteban; oper:resv, oper:cmodes, oper:mass_notice, oper:remoteban;
}; };

View file

@ -3,5 +3,4 @@ KILL <nick> <reason>
Disconnects user <nick> from the IRC server he/she Disconnects user <nick> from the IRC server he/she
is connected to with reason <reason>. is connected to with reason <reason>.
- Requires Oper Priv: oper:local_kill - Requires Oper Priv: oper:kill
- Requires Oper Priv: oper:global_kill for users not on your IRC server

View file

@ -149,8 +149,7 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define HasPrivilege(x, y) ((x)->user != NULL && (x)->user->privset != NULL && privilegeset_in_set((x)->user->privset, (y))) #define HasPrivilege(x, y) ((x)->user != NULL && (x)->user->privset != NULL && privilegeset_in_set((x)->user->privset, (y)))
#define MayHavePrivilege(x, y) (HasPrivilege((x), (y)) || (IsOper((x)) && (x)->user != NULL && (x)->user->privset == NULL)) #define MayHavePrivilege(x, y) (HasPrivilege((x), (y)) || (IsOper((x)) && (x)->user != NULL && (x)->user->privset == NULL))
#define IsOperGlobalKill(x) (HasPrivilege((x), "oper:global_kill")) #define IsOperKill(x) (HasPrivilege((x), "oper:kill"))
#define IsOperLocalKill(x) (HasPrivilege((x), "oper:local_kill"))
#define IsOperRemote(x) (HasPrivilege((x), "oper:routing")) #define IsOperRemote(x) (HasPrivilege((x), "oper:routing"))
#define IsOperUnkline(x) (HasPrivilege((x), "oper:unkline")) #define IsOperUnkline(x) (HasPrivilege((x), "oper:unkline"))
#define IsOperN(x) (HasPrivilege((x), "snomask:nick_changes")) #define IsOperN(x) (HasPrivilege((x), "snomask:nick_changes"))
@ -164,9 +163,9 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define IsOperOperwall(x) (HasPrivilege((x), "oper:operwall")) #define IsOperOperwall(x) (HasPrivilege((x), "oper:operwall"))
#define IsOperSpy(x) (HasPrivilege((x), "oper:spy")) #define IsOperSpy(x) (HasPrivilege((x), "oper:spy"))
#define IsOperInvis(x) (HasPrivilege((x), "oper:hidden")) #define IsOperInvis(x) (HasPrivilege((x), "oper:hidden"))
#define IsOperRemoteBan(x) (HasPrivilege((x), "oper:remoteban")) #define IsOperRemoteBan(x) (HasPrivilege((x), "oper:remoteban"))
#define IsOperMassNotice(x) (HasPrivilege((x), "oper:mass_notice")) #define IsOperMassNotice(x) (HasPrivilege((x), "oper:mass_notice"))
#define IsOperGeneral(x) (MayHavePrivilege((x), "oper:general")) #define IsOperGeneral(x) (MayHavePrivilege((x), "oper:general"))
#define SeesOper(target, source) (IsOper((target)) && ((!ConfigFileEntry.hide_opers && !HasPrivilege((target), "oper:hidden")) || HasPrivilege((source), "auspex:oper"))) #define SeesOper(target, source) (IsOper((target)) && ((!ConfigFileEntry.hide_opers && !HasPrivilege((target), "oper:hidden")) || HasPrivilege((source), "auspex:oper")))

View file

@ -78,9 +78,9 @@ mo_kill(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
user = parv[1]; user = parv[1];
if(!IsOperLocalKill(source_p)) if(!IsOperKill(source_p))
{ {
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "local_kill"); sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "kill");
return; return;
} }
@ -114,14 +114,6 @@ mo_kill(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
sendto_one_notice(source_p, ":KILL changed from %s to %s", user, target_p->name); sendto_one_notice(source_p, ":KILL changed from %s to %s", user, target_p->name);
} }
if(!MyConnect(target_p) && (!IsOperGlobalKill(source_p)))
{
sendto_one_notice(source_p, ":Nick %s is not on your server "
"and you do not have the global_kill flag",
target_p->name);
return;
}
/* Last chance to stop the kill */ /* Last chance to stop the kill */
moduledata.client = source_p; moduledata.client = source_p;
moduledata.target = target_p; moduledata.target = target_p;

View file

@ -44,7 +44,7 @@ auth { user = "*@127.0.0.0/8"; class = "users"; };
operator "oper" { operator "oper" {
user = "*@127.0.0.0/8"; user = "*@127.0.0.0/8";
password = "oper"; password = "oper";
flags = global_kill, remote, kline, unkline, nick_changes, flags = kill, remote, kline, unkline, nick_changes,
die, rehash, admin, xline, operwall, oper_spy, ~encrypted; die, rehash, admin, xline, operwall, oper_spy, ~encrypted;
}; };

View file

@ -44,7 +44,7 @@ auth { user = "*@127.0.0.0/8"; class = "users"; };
operator "oper" { operator "oper" {
user = "*@127.0.0.0/8"; user = "*@127.0.0.0/8";
password = "oper"; password = "oper";
flags = global_kill, remote, kline, unkline, nick_changes, flags = kill, remote, kline, unkline, nick_changes,
die, rehash, admin, xline, operwall, oper_spy, ~encrypted; die, rehash, admin, xline, operwall, oper_spy, ~encrypted;
}; };

View file

@ -44,7 +44,7 @@ auth { user = "*@127.0.0.0/8"; class = "users"; };
operator "oper" { operator "oper" {
user = "*@127.0.0.0/8"; user = "*@127.0.0.0/8";
password = "oper"; password = "oper";
flags = global_kill, remote, kline, unkline, nick_changes, flags = kill, remote, kline, unkline, nick_changes,
die, rehash, admin, xline, operwall, oper_spy, ~encrypted; die, rehash, admin, xline, operwall, oper_spy, ~encrypted;
}; };