From 1ebe6ffc92cae7ed80ac5b8dd6edfd330229ae43 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Mon, 17 Dec 2007 02:20:14 +0100 Subject: [PATCH] Add resv oper priv, enabled by default for compatibility. --- doc/example.conf | 1 + doc/reference.conf | 1 + include/s_newconf.h | 1 + modules/m_resv.c | 14 ++++++++++++++ src/newconf.c | 3 ++- src/s_newconf.c | 1 + 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/example.conf b/doc/example.conf index 1580df3..66c0745 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -226,6 +226,7 @@ operator "god" { * will not have the admin lines in * stats p and whois. * xline: allows use of /quote xline/unxline + * resv: allows use of /quote resv/unresv [DEFAULT] * operwall: allows the oper to send/receive operwalls [DEFAULT] * oper_spy: allows 'operspy' features to see through +s * channels etc. see /quote help operspy diff --git a/doc/reference.conf b/doc/reference.conf index a532fb0..08571b5 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -392,6 +392,7 @@ operator "god" { * will not have the admin lines in * stats p and whois. * xline: allows use of /quote xline/unxline + * resv: allows use of /quote resv/unresv [DEFAULT] * operwall: allows the oper to send/receive operwalls [DEFAULT] * oper_spy: allows 'operspy' features to see through +s * channels etc. see /quote help operspy diff --git a/include/s_newconf.h b/include/s_newconf.h index 89233aa..7a51149 100644 --- a/include/s_newconf.h +++ b/include/s_newconf.h @@ -171,6 +171,7 @@ extern void cluster_generic(struct Client *, const char *, int cltype, #define IsOperN(x) ((x)->flags2 & OPER_NICKS) #define IsOperK(x) ((x)->flags2 & OPER_KLINE) #define IsOperXline(x) ((x)->flags2 & OPER_XLINE) +#define IsOperResv(x) ((x)->flags2 & OPER_RESV) #define IsOperDie(x) ((x)->flags2 & OPER_DIE) #define IsOperRehash(x) ((x)->flags2 & OPER_REHASH) #define IsOperHiddenAdmin(x) ((x)->flags2 & OPER_HADMIN) diff --git a/modules/m_resv.c b/modules/m_resv.c index 1659373..963a4ee 100644 --- a/modules/m_resv.c +++ b/modules/m_resv.c @@ -84,6 +84,13 @@ mo_resv(struct Client *client_p, struct Client *source_p, int parc, const char * int temp_time; 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] [ON ] : */ 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 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(!IsOperRemoteBan(source_p)) diff --git a/src/newconf.c b/src/newconf.c index 3cd3a54..e6a549a 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -321,6 +321,7 @@ static struct mode_table flag_table[] = { {"admin", OPER_ADMIN }, {"hidden_admin", OPER_HADMIN }, {"xline", OPER_XLINE }, + {"resv", OPER_RESV }, {"operwall", OPER_OPERWALL }, {"oper_spy", OPER_SPY }, {"hidden_oper", OPER_INVIS }, @@ -465,7 +466,7 @@ conf_begin_oper(struct TopConf *tc) } 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; } diff --git a/src/s_newconf.c b/src/s_newconf.c index c5300b6..c93b57e 100644 --- a/src/s_newconf.c +++ b/src/s_newconf.c @@ -331,6 +331,7 @@ static struct oper_flags oper_flagtable[] = { OPER_GLINE, 'G', 'g' }, { OPER_KLINE, 'K', 'k' }, { OPER_XLINE, 'X', 'x' }, + { OPER_RESV, 'Q', 'q' }, { OPER_GLOBKILL, 'O', 'o' }, { OPER_LOCKILL, 'C', 'c' }, { OPER_REMOTE, 'R', 'r' },