summaryrefslogtreecommitdiff
path: root/src/chanserv.c
diff options
context:
space:
mode:
authordane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-26 14:26:06 +0000
committerdane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-26 14:26:06 +0000
commit5c3ee8a19acbdc26f191386776207fb7fefb4930 (patch)
tree6c577835b47bcd7a5f7db1f9d7f1fe33b319770d /src/chanserv.c
parentb05797bb10efec25579bda27ff4338f0b7803ac2 (diff)
BUILD : 1.7.5 (335) BUGS : 142, 152, 154, 155, 156, 157, 158 NOTES : Applied bugfix bundle patch from Trystan.
git-svn-id: svn://svn.anope.org/anope/trunk@335 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@211 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/chanserv.c')
-rw-r--r--src/chanserv.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/chanserv.c b/src/chanserv.c
index 63f9bfeca..b3948cd25 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -2515,6 +2515,21 @@ static int do_register(User * u)
return MOD_CONT;
}
+ /* Confirm that the channel is in the RFC spec */
+ if (*chan != '#' || *chan == '&') {
+ /* RFC says channels start with & or # so if the first is not # complain */
+ notice_lang(s_ChanServ, u, CHAN_SYMBOL_REQUIRED);
+ return MOD_CONT;
+ }
+
+ /* Throw a message that the channel is non existant */
+ if (!(c = findchan(chan))) {
+ alog("%s: %s attempted to register a non-existant channel [%s] ",
+ s_ChanServ, u->nick, chan);
+ notice_lang(s_NickServ, u, CHAN_REGISTER_NONE_CHANNEL, chan);
+ return MOD_CONT;
+ }
+
if (!desc) {
syntax_error(s_ChanServ, u, "REGISTER", CHAN_REGISTER_SYNTAX);
} else if (*chan == '&') {
@@ -2533,8 +2548,7 @@ static int do_register(User * u)
}
} else if (!stricmp(chan, "#")) {
notice_lang(s_ChanServ, u, CHAN_MAY_NOT_BE_REGISTERED, chan);
- } else if (!(c = findchan(chan))
- || !chan_has_user_status(c, u, CUS_OP)) {
+ } else if (!chan_has_user_status(c, u, CUS_OP)) {
notice_lang(s_ChanServ, u, CHAN_MUST_BE_CHANOP);
} else if (!is_servadmin && nc->channelmax > 0