From b4110670ae18c46af048d6fb8a22e7bb967f1cf9 Mon Sep 17 00:00:00 2001 From: Perry Lorier Date: Tue, 19 Mar 2002 10:54:28 +0000 Subject: [PATCH] Author: LordLuke Log message: >> This patch will allow an oper to list secret channels via /list if >> allowed in the F line >> >> F:LIST_CHAN:TRUE|FALSE (default is true) >> >> Tested on ircu 2.10.11pl24 > >I like this patch, could we have it against the alpha branch tho? > >cvs update -A > >should get it to you :) > This file is for: u2.10.12.alpha.00. Test.undernet.org B27AeEFfIKMpSU git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@677 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 14 ++++++++++++++ include/channel.h | 3 ++- include/client.h | 4 +++- include/ircd_features.h | 1 + ircd/channel.c | 9 +++++---- ircd/client.c | 1 + ircd/ircd_features.c | 1 + ircd/s_user.c | 2 +- 8 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14a5324..5f9874c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2002-03-19 LordLuke + + * include/channel.h: Allow opers to view +s channels in /list + + * include/client.h: Add "PRIV_LIST_CHAN" oper privilege + + * include/ircd_features.h: added "LIST_CHAN" feature + + * ircd/channel.c: Allow opers to view +s channels in /list + + * ircd/client.c: Add "PRIV_LIST_CHAN" + + * ircd/ircd_features.c: Add "LIST_CHAN" feature + 2002-03-13 Joseph Bongaarts * ircd/m_kill.c: Last of the last of the bug fixes (Thanks Spike). diff --git a/include/channel.h b/include/channel.h index 861a010..b4e31b8 100644 --- a/include/channel.h +++ b/include/channel.h @@ -106,7 +106,8 @@ struct Client; /* channel not shown but names are */ #define HiddenChannel(x) ((x) && ((x)->mode.mode & MODE_PRIVATE)) /* channel visible */ -#define ShowChannel(v,c) (PubChannel(c) || find_channel_member((v),(c))) +#define ShowChannel(v,c) (PubChannel(c) || find_channel_member((v),(c)) || \ + (IsAnOper(v)) && HasPriv(v, PRIV_LIST_CHAN)) #define PubChannel(x) ((!x) || ((x)->mode.mode & \ (MODE_PRIVATE | MODE_SECRET)) == 0) #define is_listed(x) ((x)->mode.mode & MODE_LISTED) diff --git a/include/client.h b/include/client.h index 2e56345..ffbaf54 100644 --- a/include/client.h +++ b/include/client.h @@ -97,7 +97,9 @@ struct AuthRequest; #define PRIV_WIDE_GLINE 27 /* oper can set wider G-lines */ -#define PRIV_LAST_PRIV 27 /* must be the same as the last priv */ +#define PRIV_LIST_CHAN 28 /* oper can list secret channels */ + +#define PRIV_LAST_PRIV 28 /* must be the same as the last priv */ #define _PRIV_NBITS (8 * sizeof(unsigned long)) diff --git a/include/ircd_features.h b/include/ircd_features.h index ddb31db..fa73a77 100644 --- a/include/ircd_features.h +++ b/include/ircd_features.h @@ -83,6 +83,7 @@ enum Feature { FEAT_UNLIMIT_OPER_QUERY, FEAT_LOCAL_KILL_ONLY, FEAT_CONFIG_OPERCMDS, + FEAT_LIST_CHAN, /* features that affect global opers on this server */ FEAT_OPER_KILL, diff --git a/ircd/channel.c b/ircd/channel.c index a3a7617..9cf805c 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -1313,7 +1313,8 @@ void list_next_channels(struct Client *cptr, int nr) { for (; chptr; chptr = chptr->next) { - if (!cli_user(cptr) || (SecretChannel(chptr) && !find_channel_member(cptr, chptr))) + if (!cli_user(cptr) || (!(HasPriv(cptr, PRIV_LIST_CHAN) && IsAnOper(cptr)) && + SecretChannel(chptr) && !find_channel_member(cptr, chptr))) continue; if (chptr->users > args->min_users && chptr->users < args->max_users && chptr->creationtime > args->min_time && @@ -1361,7 +1362,7 @@ void list_next_channels(struct Client *cptr, int nr) * via 'a', or on server 'B' via either 'b' or 'c', or on server D via 'd'. * * a) On server A : set CHFL_ZOMBIE for `who' (lp) and pass on the KICK. - * Remove the user immedeately when no users are left on the channel. + * Remove the user immediately when no users are left on the channel. * b) On server B : remove the user (who/lp) from the channel, send a * PART upstream (to A) and pass on the KICK. * c) KICKed by `client'; On server B : remove the user (who/lp) from the @@ -2262,7 +2263,7 @@ mode_parse_upass(struct ParseState *state, int *flag_p) } else { send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, "Re-create the channel. The channel must be *empty* for", - TStime() - state->chptr->creationtime >= 171000 ? "48 contigious hours" : "a minute or two", + TStime() - state->chptr->creationtime >= 171000 ? "48 contiguous hours" : "a minute or two", "before it can be recreated."); } return; @@ -2433,7 +2434,7 @@ mode_parse_apass(struct ParseState *state, int *flag_p) "You will NOT be able to change this password anymore once the channel is more than 48 hours old!"); send_reply(state->sptr, RPL_APASSWARN, "Use \"/MODE ", state->chptr->chname, " -A ", state->chptr->mode.apass, - "\" to remove the password and then immediatly set a new one. " + "\" to remove the password and then immediately set a new one. " "IMPORTANT: YOU CANNOT RECOVER THIS PASSWORD, EVER; " "WRITE THE PASSWORD DOWN (don't store this rescue password on disk)! " "Now set the channel user password (+u)."); diff --git a/ircd/client.c b/ircd/client.c index 3cbe27d..db6ce6f 100644 --- a/ircd/client.c +++ b/ircd/client.c @@ -118,6 +118,7 @@ static struct { { PRIV_SHOW_ALL_INVIS, FEAT_SHOW_ALL_INVISIBLE_USERS, (FLAGS_OPER | FLAGS_LOCOP) }, { PRIV_UNLIMIT_QUERY, FEAT_UNLIMIT_OPER_QUERY, (FLAGS_OPER | FLAGS_LOCOP) }, + { PRIV_LIST_CHAN, FEAT_LIST_CHAN, (FLAGS_OPER | FLAGS_LOCOP) }, { PRIV_KILL, FEAT_LOCAL_KILL_ONLY, 0 }, { PRIV_GLINE, FEAT_CONFIG_OPERCMDS, ~0 }, diff --git a/ircd/ircd_features.c b/ircd/ircd_features.c index 269af26..d9fb2d0 100644 --- a/ircd/ircd_features.c +++ b/ircd/ircd_features.c @@ -290,6 +290,7 @@ static struct FeatureDesc { F_B(UNLIMIT_OPER_QUERY, 0, 0, 0), F_B(LOCAL_KILL_ONLY, 0, 0, 0), F_B(CONFIG_OPERCMDS, 0, 0, 0), + F_B(LIST_CHAN, 0, 1, 0), /* features that affect global opers on this server */ F_B(OPER_KILL, 0, 1, 0), diff --git a/ircd/s_user.c b/ircd/s_user.c index 82709b3..b61977c 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -737,7 +737,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, * then 30 seconds ago. This is intended to get rid of * clone bots doing NICK FLOOD. -SeKs * If someone didn't change their nick for more then 60 seconds - * however, allow to do two nick changes immedately after another + * however, allow to do two nick changes immediately after another * before limiting the nick flood. -Run */ if (CurrentTime < cli_nextnick(cptr)) { -- 2.20.1