From b8bb520efdbf9646f07d16d1570d63e0a56c4d70 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sun, 12 Sep 2004 12:57:32 +0000 Subject: [PATCH] Only let services (not normal opers) force a change of +A or +u. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1136 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 5 +++++ ircd/channel.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index d03fc41..3ba5b71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-12 Michael Poole + + * include/channel.c (mode_parse_upass, mode_parse_apass): Only let + services (not normal opers) force a change of +A or +u. + 2004-09-11 Michael Poole * include/s_stats.h: Add sd_name to struct StatDesc. Stop diff --git a/ircd/channel.c b/ircd/channel.c index 29b7734..90c0d62 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -2340,6 +2340,13 @@ mode_parse_upass(struct ParseState *state, int *flag_p) return; } + /* If a non-service user is trying to force it, refuse. */ + if (state->flags & MODE_PARSE_FORCE && !IsChannelService(state->sptr)) { + send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, + "Use /JOIN", state->chptr->chname, " ."); + return; + } + /* If they are not the channel manager, they are not allowed to change it */ if (MyUser(state->sptr) && !IsChannelManager(state->member)) { if (*state->chptr->mode.apass) { @@ -2440,6 +2447,13 @@ mode_parse_apass(struct ParseState *state, int *flag_p) return; } + /* If a non-service user is trying to force it, refuse. */ + if (state->flags & MODE_PARSE_FORCE && !IsChannelService(state->sptr)) { + send_reply(state->sptr, ERR_NOTMANAGER, state->chptr->chname, + "Use /JOIN", state->chptr->chname, " ."); + return; + } + /* Don't allow to change the Apass if the channel is older than 48 hours. */ if (TStime() - state->chptr->creationtime >= 172800 && !IsAnOper(state->sptr)) { send_reply(state->sptr, ERR_CHANSECURED, state->chptr->chname); -- 2.20.1