Add resv oper priv, enabled by default for compatibility.

This commit is contained in:
Jilles Tjoelker 2007-12-17 02:20:14 +01:00
parent 33b310b376
commit 1ebe6ffc92
6 changed files with 20 additions and 1 deletions

View file

@ -226,6 +226,7 @@ operator "god" {
* will not have the admin lines in * will not have the admin lines in
* stats p and whois. * stats p and whois.
* xline: allows use of /quote xline/unxline * xline: allows use of /quote xline/unxline
* resv: allows use of /quote resv/unresv [DEFAULT]
* operwall: allows the oper to send/receive operwalls [DEFAULT] * operwall: allows the oper to send/receive operwalls [DEFAULT]
* oper_spy: allows 'operspy' features to see through +s * oper_spy: allows 'operspy' features to see through +s
* channels etc. see /quote help operspy * channels etc. see /quote help operspy

View file

@ -392,6 +392,7 @@ operator "god" {
* will not have the admin lines in * will not have the admin lines in
* stats p and whois. * stats p and whois.
* xline: allows use of /quote xline/unxline * xline: allows use of /quote xline/unxline
* resv: allows use of /quote resv/unresv [DEFAULT]
* operwall: allows the oper to send/receive operwalls [DEFAULT] * operwall: allows the oper to send/receive operwalls [DEFAULT]
* oper_spy: allows 'operspy' features to see through +s * oper_spy: allows 'operspy' features to see through +s
* channels etc. see /quote help operspy * channels etc. see /quote help operspy

View file

@ -171,6 +171,7 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define IsOperN(x) ((x)->flags2 & OPER_NICKS) #define IsOperN(x) ((x)->flags2 & OPER_NICKS)
#define IsOperK(x) ((x)->flags2 & OPER_KLINE) #define IsOperK(x) ((x)->flags2 & OPER_KLINE)
#define IsOperXline(x) ((x)->flags2 & OPER_XLINE) #define IsOperXline(x) ((x)->flags2 & OPER_XLINE)
#define IsOperResv(x) ((x)->flags2 & OPER_RESV)
#define IsOperDie(x) ((x)->flags2 & OPER_DIE) #define IsOperDie(x) ((x)->flags2 & OPER_DIE)
#define IsOperRehash(x) ((x)->flags2 & OPER_REHASH) #define IsOperRehash(x) ((x)->flags2 & OPER_REHASH)
#define IsOperHiddenAdmin(x) ((x)->flags2 & OPER_HADMIN) #define IsOperHiddenAdmin(x) ((x)->flags2 & OPER_HADMIN)

View file

@ -84,6 +84,13 @@ mo_resv(struct Client *client_p, struct Client *source_p, int parc, const char *
int temp_time; int temp_time;
int loc = 1; int loc = 1;
if(!IsOperResv(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "resv");
return 0;
}
/* RESV [time] <name> [ON <server>] :<reason> */ /* RESV [time] <name> [ON <server>] :<reason> */
if((temp_time = valid_temp_time(parv[loc])) >= 0) if((temp_time = valid_temp_time(parv[loc])) >= 0)
@ -370,6 +377,13 @@ cluster_resv(struct Client *source_p, int temp_time, const char *name,
static int static int
mo_unresv(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) mo_unresv(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{ {
if(!IsOperResv(source_p))
{
sendto_one(source_p, form_str(ERR_NOPRIVS),
me.name, source_p->name, "resv");
return 0;
}
if((parc == 4) && (irccmp(parv[2], "ON") == 0)) if((parc == 4) && (irccmp(parv[2], "ON") == 0))
{ {
if(!IsOperRemoteBan(source_p)) if(!IsOperRemoteBan(source_p))

View file

@ -321,6 +321,7 @@ static struct mode_table flag_table[] = {
{"admin", OPER_ADMIN }, {"admin", OPER_ADMIN },
{"hidden_admin", OPER_HADMIN }, {"hidden_admin", OPER_HADMIN },
{"xline", OPER_XLINE }, {"xline", OPER_XLINE },
{"resv", OPER_RESV },
{"operwall", OPER_OPERWALL }, {"operwall", OPER_OPERWALL },
{"oper_spy", OPER_SPY }, {"oper_spy", OPER_SPY },
{"hidden_oper", OPER_INVIS }, {"hidden_oper", OPER_INVIS },
@ -465,7 +466,7 @@ conf_begin_oper(struct TopConf *tc)
} }
yy_oper = make_oper_conf(); yy_oper = make_oper_conf();
yy_oper->flags |= OPER_ENCRYPTED|OPER_OPERWALL|OPER_REMOTEBAN; yy_oper->flags |= OPER_ENCRYPTED|OPER_RESV|OPER_OPERWALL|OPER_REMOTEBAN;
return 0; return 0;
} }

View file

@ -331,6 +331,7 @@ static struct oper_flags oper_flagtable[] =
{ OPER_GLINE, 'G', 'g' }, { OPER_GLINE, 'G', 'g' },
{ OPER_KLINE, 'K', 'k' }, { OPER_KLINE, 'K', 'k' },
{ OPER_XLINE, 'X', 'x' }, { OPER_XLINE, 'X', 'x' },
{ OPER_RESV, 'Q', 'q' },
{ OPER_GLOBKILL, 'O', 'o' }, { OPER_GLOBKILL, 'O', 'o' },
{ OPER_LOCKILL, 'C', 'c' }, { OPER_LOCKILL, 'C', 'c' },
{ OPER_REMOTE, 'R', 'r' }, { OPER_REMOTE, 'R', 'r' },