1
0
Fork 0
mirror of https://github.com/pissnet/angiosperm.git synced 2025-05-13 03:55:03 +01:00

Replace most checks for +o with oper:general

I'm preparing to PR a succession of privs changes with the ultimate goal
of severely limiting the scope of the binary oper/user dichotomy and
move conceptually distinct oper functions into their own privs.

Accomplishing this is a non-trivial task, and can wait, but it's
inconvenient now to have such functions enabled by the same mechanism
that grants any privs at all--so I'm moving all of them to a
transitional priv with the intention of eroding that later.
This commit is contained in:
Ed Kellett 2019-07-07 05:34:28 +01:00
parent ad7ecd5cbb
commit d4f7eb4ce6
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC
34 changed files with 91 additions and 74 deletions

View file

@ -15,6 +15,7 @@
#include "s_conf.h"
#include "snomask.h"
#include "numeric.h"
#include "s_newconf.h"
static const char restrict_desc[] = "Restricts channel creation to authenticated users and IRC operators only";
@ -32,6 +33,6 @@ h_can_create_channel_authenticated(hook_data_client_approval *data)
{
struct Client *source_p = data->client;
if (*source_p->user->suser == '\0' && !IsOper(source_p))
if (*source_p->user->suser == '\0' && !IsOperGeneral(source_p))
data->approved = ERR_NEEDREGGEDNICK;
}

View file

@ -15,6 +15,7 @@
#include "s_conf.h"
#include "snomask.h"
#include "numeric.h"
#include "s_newconf.h"
static const char restrict_desc[] = "Restricts channel creation to IRC operators";
@ -32,7 +33,7 @@ h_can_create_channel_authenticated(hook_data_client_approval *data)
{
struct Client *source_p = data->client;
if (!IsOper(source_p))
if (!IsOperGeneral(source_p))
{
sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only.");
data->approved = ERR_NEEDREGGEDNICK;

View file

@ -32,7 +32,7 @@ h_noi_umode_changed(hook_data_umode_changed *hdata)
{
struct Client *source_p = hdata->client;
if (MyClient(source_p) && !IsOper(source_p) && !IsInvisible(source_p)) {
if (MyClient(source_p) && !IsOperGeneral(source_p) && !IsInvisible(source_p)) {
SetInvisible(source_p);
}
}

View file

@ -470,9 +470,9 @@ doing_stats_hook(hook_data_int *hdata)
source_p = hdata->client;
if(hdata->arg2 != (int) 's')
return;
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper(source_p))
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOperGeneral(source_p))
return;
if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper(source_p))
if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOperGeneral(source_p))
{
hurt = hurt_find(source_p->sockhost);
if (hurt != NULL)

View file

@ -64,7 +64,7 @@ m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *
*p = '\0';
/* Allow ircops to search for forwards to nonexistent channels */
if(!IsOper(source_p))
if(!IsOperGeneral(source_p))
{
if((chptr = find_channel(parv[1])) == NULL || (msptr = find_channel_membership(chptr, source_p)) == NULL)
{

View file

@ -12,6 +12,7 @@
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "s_newconf.h"
/* undefine this to allow anyone to receive whois notifications */
#define OPERONLY
@ -57,7 +58,7 @@ show_whois(hook_data_client *data)
if(MyClient(target_p) &&
#ifdef OPERONLY
IsOper(target_p) &&
IsOperGeneral(target_p) &&
#endif
(source_p != target_p) &&
(target_p->snomask & snomask_modes['W']))