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

@ -64,7 +64,7 @@ m_ban(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
{
sendto_one_notice(source_p, ":The BAN command is not user-accessible.");
sendto_one_notice(source_p, ":To ban a user from a channel, see /QUOTE HELP CMODE");
if (IsOper(source_p))
if (IsOperGeneral(source_p))
sendto_one_notice(source_p, ":To ban a user from a server or from the network, see /QUOTE HELP KLINE");
}

View file

@ -209,7 +209,7 @@ m_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
continue;
}
if(splitmode && !IsOper(source_p) && (*name != '&') &&
if(splitmode && !IsOperGeneral(source_p) && (*name != '&') &&
ConfigChannel.no_join_on_split)
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
@ -269,7 +269,7 @@ m_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
continue;
}
if(splitmode && !IsOper(source_p) && (*name != '&') &&
if(splitmode && !IsOperGeneral(source_p) && (*name != '&') &&
ConfigChannel.no_create_on_split)
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
@ -320,7 +320,7 @@ m_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
chptr = chptr2;
if(flags == 0 &&
!IsOper(source_p) && !IsExemptSpambot(source_p))
!IsOperGeneral(source_p) && !IsExemptSpambot(source_p))
check_spambot_warning(source_p, name);
/* add the user to the channel */
@ -966,7 +966,7 @@ do_join_0(struct Client *client_p, struct Client *source_p)
while((ptr = source_p->user->channel.head))
{
if(MyConnect(source_p) &&
!IsOper(source_p) && !IsExemptSpambot(source_p))
!IsOperGeneral(source_p) && !IsExemptSpambot(source_p))
check_spambot_warning(source_p, NULL);
msptr = ptr->data;
@ -987,7 +987,7 @@ check_channel_name_loc(struct Client *source_p, const char *name)
if(EmptyString(name))
return false;
if(ConfigFileEntry.disable_fake_channels && !IsOper(source_p))
if(ConfigFileEntry.disable_fake_channels && !IsOperGeneral(source_p))
{
for(p = name; *p; ++p)
{

View file

@ -513,7 +513,7 @@ msg_channel(enum message_type msgtype,
if((result = can_send(chptr, source_p, NULL)))
{
if(result != CAN_SEND_OPV && MyClient(source_p) &&
!IsOper(source_p) &&
!IsOperGeneral(source_p) &&
!add_channel_target(source_p, chptr))
{
sendto_one(source_p, form_str(ERR_TARGCHANGE),
@ -531,7 +531,7 @@ msg_channel(enum message_type msgtype,
(!(chptr->mode.mode & MODE_NOPRIVMSGS) ||
IsMember(source_p, chptr)))
{
if(MyClient(source_p) && !IsOper(source_p) &&
if(MyClient(source_p) && !IsOperGeneral(source_p) &&
!add_channel_target(source_p, chptr))
{
sendto_one(source_p, form_str(ERR_TARGCHANGE),
@ -724,7 +724,7 @@ msg_client(enum message_type msgtype,
source_p->localClient->last = rb_current_time();
/* auto cprivmsg/cnotice */
do_floodcount = !IsOper(source_p) &&
do_floodcount = !IsOperGeneral(source_p) &&
!find_allowing_channel(source_p, target_p);
/* target change stuff, dont limit ctcp replies as that

View file

@ -642,7 +642,7 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
source_p->localClient->last_nick_change = rb_current_time();
source_p->localClient->number_of_nick_changes++;
if(ConfigFileEntry.anti_nick_flood && !IsOper(source_p) &&
if(ConfigFileEntry.anti_nick_flood && !IsOperGeneral(source_p) &&
source_p->localClient->number_of_nick_changes > ConfigFileEntry.max_nick_changes)
{
sendto_one(source_p, form_str(ERR_NICKTOOFAST),

View file

@ -38,6 +38,7 @@
#include "packet.h"
#include "inline/stringops.h"
#include "hook.h"
#include "s_newconf.h"
static const char part_desc[] = "Provides the PART command to leave a channel";
@ -117,7 +118,7 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, co
return;
}
if(MyConnect(source_p) && !IsOper(source_p) && !IsExemptSpambot(source_p))
if(MyConnect(source_p) && !IsOperGeneral(source_p) && !IsExemptSpambot(source_p))
check_spambot_warning(source_p, NULL);
/*

View file

@ -33,6 +33,7 @@
#include "modules.h"
#include "s_conf.h"
#include "inline/stringops.h"
#include "s_newconf.h"
static const char quit_desc[] = "Provides the QUIT command to allow a user to leave the network";
@ -86,7 +87,7 @@ m_quit(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
comment = reason;
}
if (comment == NULL || (!IsOper(source_p) && hdata.reason == hdata.orig_reason &&
if (comment == NULL || (!IsOperGeneral(source_p) && hdata.reason == hdata.orig_reason &&
(source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
rb_current_time()))
{