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:
parent
ad7ecd5cbb
commit
d4f7eb4ce6
34 changed files with 91 additions and 74 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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);
|
||||
|
||||
/*
|
||||
|
|
|
@ -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()))
|
||||
{
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "s_conf.h"
|
||||
#include "s_serv.h"
|
||||
#include "packet.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static const char away_desc[] = "Provides the AWAY command to set yourself away";
|
||||
|
||||
|
@ -97,7 +98,7 @@ m_away(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
|
|||
/* Rate limit this because it is sent to common channels. */
|
||||
if (MyClient(source_p))
|
||||
{
|
||||
if(!IsOper(source_p) &&
|
||||
if(!IsOperGeneral(source_p) &&
|
||||
source_p->localClient->next_away > rb_current_time())
|
||||
{
|
||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "msg.h"
|
||||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static const char info_desc[] =
|
||||
"Provides the INFO command for retrieving server copyright, credits, and other info";
|
||||
|
@ -716,7 +717,7 @@ mo_info(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
info_spy(source_p);
|
||||
send_info_text(source_p);
|
||||
|
||||
if(IsOper(source_p))
|
||||
if(IsOperGeneral(source_p))
|
||||
{
|
||||
send_conf_options(source_p);
|
||||
sendto_one_numeric(source_p, RPL_INFO, ":%s",
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "modules.h"
|
||||
#include "packet.h"
|
||||
#include "tgchange.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static const char invite_desc[] = "Provides /invite";
|
||||
|
||||
|
@ -176,7 +177,7 @@ m_invite(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
|
|||
|
||||
if(MyConnect(source_p))
|
||||
{
|
||||
if (ConfigFileEntry.target_change && !IsOper(source_p) &&
|
||||
if (ConfigFileEntry.target_change && !IsOperGeneral(source_p) &&
|
||||
!find_allowing_channel(source_p, target_p) &&
|
||||
!add_target(source_p, target_p))
|
||||
{
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "modules.h"
|
||||
#include "s_serv.h"
|
||||
#include "supported.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static const char knock_desc[] = "Provides the KNOCK command to ask for an invite to an invite-only channel";
|
||||
|
||||
|
@ -142,7 +143,7 @@ m_knock(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
* allow one knock per user per knock_delay
|
||||
* allow one knock per channel per knock_delay_channel
|
||||
*/
|
||||
if(!IsOper(source_p) &&
|
||||
if(!IsOperGeneral(source_p) &&
|
||||
(source_p->localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "msg.h"
|
||||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static const char names_desc[] = "Provides the NAMES command to view users on a channel";
|
||||
|
||||
|
@ -88,7 +89,7 @@ m_names(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
}
|
||||
else
|
||||
{
|
||||
if(!IsOper(source_p))
|
||||
if(!IsOperGeneral(source_p))
|
||||
{
|
||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
||||
{
|
||||
|
|
|
@ -334,7 +334,7 @@ h_svc_stats(hook_data_int *data)
|
|||
char statchar = (char) data->arg2;
|
||||
rb_dlink_node *ptr;
|
||||
|
||||
if (statchar == 'U' && IsOper(data->client))
|
||||
if (statchar == 'U' && IsOperGeneral(data->client))
|
||||
{
|
||||
RB_DLINK_FOREACH(ptr, service_list.head)
|
||||
{
|
||||
|
|
|
@ -212,7 +212,7 @@ m_stats(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
|
||||
statchar = parv[1][0];
|
||||
|
||||
if(MyClient(source_p) && !IsOper(source_p) && parc > 2)
|
||||
if(MyClient(source_p) && !IsOperGeneral(source_p) && parc > 2)
|
||||
{
|
||||
/* Check the user is actually allowed to do /stats, and isnt flooding */
|
||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
|
||||
|
@ -253,7 +253,7 @@ m_stats(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
me.name, source_p->name, "admin");
|
||||
goto stats_out;
|
||||
}
|
||||
if(cmd->need_oper && !IsOper(source_p))
|
||||
if(cmd->need_oper && !IsOperGeneral(source_p))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
|
@ -322,7 +322,7 @@ stats_connect(struct Client *source_p)
|
|||
|
||||
if((ConfigFileEntry.stats_c_oper_only ||
|
||||
(ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
|
||||
!IsOper(source_p))
|
||||
!IsOperGeneral(source_p))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str(ERR_NOPRIVILEGES));
|
||||
|
@ -338,7 +338,7 @@ stats_connect(struct Client *source_p)
|
|||
|
||||
s = buf;
|
||||
|
||||
if(IsOper(source_p))
|
||||
if(IsOperGeneral(source_p))
|
||||
{
|
||||
if(ServerConfAutoconn(server_p))
|
||||
*s++ = 'A';
|
||||
|
@ -527,7 +527,7 @@ stats_hubleaf(struct Client *source_p)
|
|||
|
||||
if((ConfigFileEntry.stats_h_oper_only ||
|
||||
(ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
|
||||
!IsOper(source_p))
|
||||
!IsOperGeneral(source_p))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
|
@ -554,12 +554,12 @@ static void
|
|||
stats_auth (struct Client *source_p)
|
||||
{
|
||||
/* Oper only, if unopered, return ERR_NOPRIVS */
|
||||
if((ConfigFileEntry.stats_i_oper_only == 2) && !IsOper (source_p))
|
||||
if((ConfigFileEntry.stats_i_oper_only == 2) && !IsOperGeneral (source_p))
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
|
||||
/* If unopered, Only return matching auth blocks */
|
||||
else if((ConfigFileEntry.stats_i_oper_only == 1) && !IsOper (source_p))
|
||||
else if((ConfigFileEntry.stats_i_oper_only == 1) && !IsOperGeneral (source_p))
|
||||
{
|
||||
struct ConfItem *aconf;
|
||||
char *name, *host, *user, *classname;
|
||||
|
@ -598,12 +598,12 @@ static void
|
|||
stats_tklines(struct Client *source_p)
|
||||
{
|
||||
/* Oper only, if unopered, return ERR_NOPRIVS */
|
||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper (source_p))
|
||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOperGeneral (source_p))
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
|
||||
/* If unopered, Only return matching klines */
|
||||
else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper (source_p))
|
||||
else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOperGeneral (source_p))
|
||||
{
|
||||
struct ConfItem *aconf;
|
||||
char *host, *pass, *user, *oper_reason;
|
||||
|
@ -700,12 +700,12 @@ static void
|
|||
stats_klines(struct Client *source_p)
|
||||
{
|
||||
/* Oper only, if unopered, return ERR_NOPRIVS */
|
||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOper (source_p))
|
||||
if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOperGeneral (source_p))
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
|
||||
/* If unopered, Only return matching klines */
|
||||
else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOper (source_p))
|
||||
else if((ConfigFileEntry.stats_k_oper_only == 1) && !IsOperGeneral (source_p))
|
||||
{
|
||||
struct ConfItem *aconf;
|
||||
char *host, *pass, *user, *oper_reason;
|
||||
|
@ -775,7 +775,7 @@ stats_oper(struct Client *source_p)
|
|||
struct oper_conf *oper_p;
|
||||
rb_dlink_node *ptr;
|
||||
|
||||
if(!IsOper(source_p) && ConfigFileEntry.stats_o_oper_only)
|
||||
if(!IsOperGeneral(source_p) && ConfigFileEntry.stats_o_oper_only)
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
|
@ -789,7 +789,7 @@ stats_oper(struct Client *source_p)
|
|||
sendto_one_numeric(source_p, RPL_STATSOLINE,
|
||||
form_str(RPL_STATSOLINE),
|
||||
oper_p->username, oper_p->host, oper_p->name,
|
||||
IsOper(source_p) ? oper_p->privset->name : "0", "-1");
|
||||
IsOperGeneral(source_p) ? oper_p->privset->name : "0", "-1");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -853,7 +853,7 @@ stats_operedup (struct Client *source_p)
|
|||
static void
|
||||
stats_ports (struct Client *source_p)
|
||||
{
|
||||
if(!IsOper (source_p) && ConfigFileEntry.stats_P_oper_only)
|
||||
if(!IsOperGeneral (source_p) && ConfigFileEntry.stats_P_oper_only)
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
else
|
||||
|
@ -1181,7 +1181,7 @@ stats_servers (struct Client *source_p)
|
|||
int days, hours, minutes;
|
||||
int j = 0;
|
||||
|
||||
if(ConfigServerHide.flatten_links && !IsOper(source_p) &&
|
||||
if(ConfigServerHide.flatten_links && !IsOperGeneral(source_p) &&
|
||||
!IsExemptShide(source_p))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
|
@ -1257,7 +1257,7 @@ stats_gecos(struct Client *source_p)
|
|||
static void
|
||||
stats_class(struct Client *source_p)
|
||||
{
|
||||
if(ConfigFileEntry.stats_y_oper_only && !IsOper(source_p))
|
||||
if(ConfigFileEntry.stats_y_oper_only && !IsOperGeneral(source_p))
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
form_str (ERR_NOPRIVILEGES));
|
||||
else
|
||||
|
@ -1524,7 +1524,7 @@ stats_servlinks (struct Client *source_p)
|
|||
int j = 0;
|
||||
char buf[128];
|
||||
|
||||
if(ConfigServerHide.flatten_links && !IsOper (source_p) &&
|
||||
if(ConfigServerHide.flatten_links && !IsOperGeneral (source_p) &&
|
||||
!IsExemptShide(source_p))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
|
||||
|
@ -1553,7 +1553,7 @@ stats_servlinks (struct Client *source_p)
|
|||
rb_current_time() - target_p->localClient->firsttime,
|
||||
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||
IsOper (source_p) ? show_capabilities (target_p) : "TS");
|
||||
IsOperGeneral (source_p) ? show_capabilities (target_p) : "TS");
|
||||
}
|
||||
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
|
@ -1659,7 +1659,7 @@ stats_ltrace(struct Client *source_p, int parc, const char *parv[])
|
|||
stats_l_list(source_p, name, doall, wilds, &local_oper_list, statchar, stats_l_should_show_oper);
|
||||
}
|
||||
|
||||
if (!ConfigServerHide.flatten_links || IsOper(source_p) ||
|
||||
if (!ConfigServerHide.flatten_links || IsOperGeneral(source_p) ||
|
||||
IsExemptShide(source_p))
|
||||
stats_l_list(source_p, name, doall, wilds, &serv_list, statchar, NULL);
|
||||
|
||||
|
@ -1713,7 +1713,7 @@ stats_l_client(struct Client *source_p, struct Client *target_p,
|
|||
rb_current_time() - target_p->localClient->firsttime,
|
||||
(rb_current_time() > target_p->localClient->lasttime) ?
|
||||
(rb_current_time() - target_p->localClient->lasttime) : 0,
|
||||
IsOper(source_p) ? show_capabilities(target_p) : "-");
|
||||
IsOperGeneral(source_p) ? show_capabilities(target_p) : "-");
|
||||
}
|
||||
|
||||
else
|
||||
|
|
|
@ -112,7 +112,7 @@ m_topic(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
}
|
||||
|
||||
if(MyClient(source_p) && !is_chanop_voiced(msptr) &&
|
||||
!IsOper(source_p) &&
|
||||
!IsOperGeneral(source_p) &&
|
||||
!add_channel_target(source_p, chptr))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_TARGCHANGE),
|
||||
|
|
|
@ -125,7 +125,7 @@ m_trace(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
/* giving this out with flattened links defeats the
|
||||
* object --fl
|
||||
*/
|
||||
if(IsOper(source_p) || IsExemptShide(source_p) ||
|
||||
if(IsOperGeneral(source_p) || IsExemptShide(source_p) ||
|
||||
!ConfigServerHide.flatten_links)
|
||||
sendto_one_numeric(source_p, RPL_TRACELINK,
|
||||
form_str(RPL_TRACELINK),
|
||||
|
|
|
@ -192,7 +192,7 @@ m_who(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
|||
|
||||
if(chptr != NULL)
|
||||
{
|
||||
if (!IsOper(source_p) && !ratelimit_client_who(source_p, rb_dlink_list_length(&chptr->members)/50))
|
||||
if (!IsOperGeneral(source_p) && !ratelimit_client_who(source_p, rb_dlink_list_length(&chptr->members)/50))
|
||||
{
|
||||
sendto_one(source_p, form_str(RPL_LOAD2HI),
|
||||
me.name, source_p->name, "WHO");
|
||||
|
@ -254,7 +254,7 @@ m_who(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
|||
flood_endgrace(source_p);
|
||||
|
||||
/* it has to be a global who at this point, limit it */
|
||||
if(!IsOper(source_p))
|
||||
if(!IsOperGeneral(source_p))
|
||||
{
|
||||
if((last_used + ConfigFileEntry.pace_wait) > rb_current_time() || !ratelimit_client(source_p, 1))
|
||||
{
|
||||
|
@ -324,7 +324,7 @@ who_common_channel(struct Client *source_p, struct Channel *chptr,
|
|||
if((mask == NULL) ||
|
||||
match(mask, target_p->name) || match(mask, target_p->username) ||
|
||||
match(mask, target_p->host) || match(mask, target_p->servptr->name) ||
|
||||
(IsOper(source_p) && match(mask, target_p->orighost)) ||
|
||||
(IsOperGeneral(source_p) && match(mask, target_p->orighost)) ||
|
||||
match(mask, target_p->info))
|
||||
{
|
||||
do_who(source_p, target_p, NULL, fmt);
|
||||
|
@ -395,7 +395,7 @@ who_global(struct Client *source_p, const char *mask, int server_oper, int opers
|
|||
if(!mask ||
|
||||
match(mask, target_p->name) || match(mask, target_p->username) ||
|
||||
match(mask, target_p->host) || match(mask, target_p->servptr->name) ||
|
||||
(IsOper(source_p) && match(mask, target_p->orighost)) ||
|
||||
(IsOperGeneral(source_p) && match(mask, target_p->orighost)) ||
|
||||
match(mask, target_p->info))
|
||||
{
|
||||
do_who(source_p, target_p, NULL, fmt);
|
||||
|
@ -495,7 +495,7 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt
|
|||
source_p->name, msptr ? msptr->chptr->chname : "*",
|
||||
target_p->username, target_p->host,
|
||||
target_p->servptr->name, target_p->name, status,
|
||||
ConfigServerHide.flatten_links && !IsOper(source_p) && !IsExemptShide(source_p) ? 0 : target_p->hopcount,
|
||||
ConfigServerHide.flatten_links && !IsOperGeneral(source_p) && !IsExemptShide(source_p) ? 0 : target_p->hopcount,
|
||||
target_p->info);
|
||||
else
|
||||
{
|
||||
|
@ -525,7 +525,7 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt
|
|||
if (fmt->fields & FIELD_FLAGS)
|
||||
append_format(str, sizeof str, &pos, " %s", status);
|
||||
if (fmt->fields & FIELD_HOP)
|
||||
append_format(str, sizeof str, &pos, " %d", ConfigServerHide.flatten_links && !IsOper(source_p) && !IsExemptShide(source_p) ? 0 : target_p->hopcount);
|
||||
append_format(str, sizeof str, &pos, " %d", ConfigServerHide.flatten_links && !IsOperGeneral(source_p) && !IsExemptShide(source_p) ? 0 : target_p->hopcount);
|
||||
if (fmt->fields & FIELD_IDLE)
|
||||
append_format(str, sizeof str, &pos, " %d", (int)(MyClient(target_p) ? rb_current_time() - target_p->localClient->last : 0));
|
||||
if (fmt->fields & FIELD_ACCOUNT)
|
||||
|
|
|
@ -89,7 +89,7 @@ m_whois(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
|
|||
return;
|
||||
}
|
||||
|
||||
if(!IsOper(source_p))
|
||||
if(!IsOperGeneral(source_p))
|
||||
{
|
||||
/* seeing as this is going across servers, we should limit it */
|
||||
if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time() || !ratelimit_client(source_p, 2))
|
||||
|
@ -340,7 +340,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
|||
|
||||
sendto_one_numeric(source_p, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE),
|
||||
target_p->name, cbuf);
|
||||
if((source_p == target_p || IsOper(source_p)) &&
|
||||
if((source_p == target_p || IsOperGeneral(source_p)) &&
|
||||
target_p->certfp != NULL)
|
||||
sendto_one_numeric(source_p, RPL_WHOISCERTFP,
|
||||
form_str(RPL_WHOISCERTFP),
|
||||
|
@ -349,7 +349,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
|||
|
||||
if(MyClient(target_p))
|
||||
{
|
||||
if (IsDynSpoof(target_p) && (IsOper(source_p) || source_p == target_p))
|
||||
if (IsDynSpoof(target_p) && (IsOperGeneral(source_p) || source_p == target_p))
|
||||
{
|
||||
/* trick here: show a nonoper their own IP if
|
||||
* dynamic spoofed but not if auth{} spoofed
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "msg.h"
|
||||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
#include "s_newconf.h"
|
||||
|
||||
static const char whowas_desc[] =
|
||||
"Provides the WHOWAS command to display information on a disconnected user";
|
||||
|
@ -70,7 +71,7 @@ m_whowas(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
|
|||
|
||||
static time_t last_used = 0L;
|
||||
|
||||
if(MyClient(source_p) && !IsOper(source_p))
|
||||
if(MyClient(source_p) && !IsOperGeneral(source_p))
|
||||
{
|
||||
if(last_used + (parc > 3 ? ConfigFileEntry.pace_wait :
|
||||
ConfigFileEntry.pace_wait_simple
|
||||
|
|
|
@ -118,7 +118,7 @@ allow_message(struct Client *source_p, struct Client *target_p)
|
|||
return true;
|
||||
|
||||
/* XXX: controversial? allow opers to send through +g */
|
||||
if (IsOper(source_p))
|
||||
if (IsOperGeneral(source_p))
|
||||
return true;
|
||||
|
||||
if (accept_message(source_p, target_p))
|
||||
|
@ -168,7 +168,7 @@ add_callerid_accept_for_source(enum message_type msgtype, struct Client *source_
|
|||
if(msgtype != MESSAGE_TYPE_NOTICE &&
|
||||
IsSetAnyCallerID(source_p) &&
|
||||
!accept_message(target_p, source_p) &&
|
||||
!IsOper(target_p))
|
||||
!IsOperGeneral(target_p))
|
||||
{
|
||||
if(rb_dlink_list_length(&source_p->localClient->allow_list) <
|
||||
(unsigned long)ConfigFileEntry.max_accept)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue