From 5a191ce5a64bb2b626d6a79c5d63e589f55d9dad Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Thu, 22 Jan 2009 11:49:08 +0000 Subject: [PATCH] Backport of fix for bug 1000, do not allow a nick to be grouped if the IRCd protocol deems the nick invalid. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1926 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/ns_group.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/ns_group.c b/src/core/ns_group.c index 2b0b9a92a..3be4060d9 100644 --- a/src/core/ns_group.c +++ b/src/core/ns_group.c @@ -6,8 +6,8 @@ * Please read COPYING and README for further details. * * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * + * Based on the original code of Services by Andy Church. + * * $Id$ * */ @@ -111,6 +111,11 @@ int do_group(User * u) return MOD_CONT; } + if (!anope_valid_nick(u->nick)) { + notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, u->nick); + return MOD_CONT; + } + if (RestrictOperNicks) { for (i = 0; i < RootNumber; i++) { if (stristr(u->nick, ServicesRoots[i]) && !is_oper(u)) { @@ -233,7 +238,7 @@ int do_group(User * u) if (ircd->modeonreg) { len = strlen(ircd->modeonreg); strncpy(modes,ircd->modeonreg,512); - if(ircd->rootmodeonid && is_services_root(u)) { + if(ircd->rootmodeonid && is_services_root(u)) { strncat(modes,ircd->rootmodeonid,512-len); } else if(ircd->adminmodeonid && is_services_admin(u)) { strncat(modes,ircd->adminmodeonid,512-len);