summaryrefslogtreecommitdiff
path: root/src/core/cs_access.c
diff options
context:
space:
mode:
authoradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-06-23 16:56:38 +0000
committeradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-06-23 16:56:38 +0000
commitdc8f7923f4c9cd685a338072bcc2bb351bf575d9 (patch)
treecb55529a96b40d43b2646640a06cc248efa76efb /src/core/cs_access.c
parent59c1a509b4264648a6ef61e96b85f06f735d6dd6 (diff)
Adds check for using commands on non-registered channels before the
commands are called git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2336 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/cs_access.c')
-rw-r--r--src/core/cs_access.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/cs_access.c b/src/core/cs_access.c
index 7a4ad8a78..8798d7c20 100644
--- a/src/core/cs_access.c
+++ b/src/core/cs_access.c
@@ -95,7 +95,7 @@ class CommandCSAccess : public Command
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
const char *s = params.size() > 3 ? params[3].c_str() : NULL;
- ChannelInfo *ci;
+ ChannelInfo *ci = cs_findchan(chan);
NickAlias *na = NULL;
NickCore *nc;
ChanAccess *access;
@@ -109,8 +109,6 @@ class CommandCSAccess : public Command
* Else (ADD), we require a level (which implies a nick). */
if (!cmd || ((is_list || !stricmp(cmd, "CLEAR")) ? 0 : (!stricmp(cmd, "DEL")) ? (!nick || s) : !s))
this->OnSyntaxError(u);
- else if (!(ci = cs_findchan(chan)))
- notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
/* We still allow LIST in xOP mode, but not others */
else if ((ci->flags & CI_XOP) && !is_list)
{
@@ -367,7 +365,7 @@ class CommandCSLevels : public Command
const char *s = params.size() > 3 ? params[3].c_str() : NULL;
char *error;
- ChannelInfo *ci;
+ ChannelInfo *ci = cs_findchan(chan);
int level;
int i;
@@ -378,8 +376,6 @@ class CommandCSLevels : public Command
|| ((stricmp(cmd, "SET") == 0) ? !s
: ((strnicmp(cmd, "DIS", 3) == 0)) ? (!what || s) : !!what)) {
this->OnSyntaxError(u);
- } else if (!(ci = cs_findchan(chan))) {
- notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
} else if (ci->flags & CI_XOP) {
notice_lang(s_ChanServ, u, CHAN_LEVELS_XOP);
} else if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/change")) {