summaryrefslogtreecommitdiff
path: root/src/cmd_oper.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-16 18:49:48 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-16 18:49:48 +0000
commit55fdc886a1a7941ef1d0162ac73cbf368cd66151 (patch)
treedb7daa63d4015892fa48e41f1648ff29faeb664e /src/cmd_oper.cpp
parentbba10a7af4df8f943152607ded0c3d45460b1d73 (diff)
Checking to prevent dodgy opertypes (opertypes must follow the same syntax as nicks now)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3229 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_oper.cpp')
-rw-r--r--src/cmd_oper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd_oper.cpp b/src/cmd_oper.cpp
index 8e57329d4..15e0df3c4 100644
--- a/src/cmd_oper.cpp
+++ b/src/cmd_oper.cpp
@@ -110,6 +110,13 @@ void cmd_oper::Handle (char **parameters, int pcnt, userrec *user)
Config->ConfValue("type","host",j,HostName,&Config->config_f);
if (*HostName)
ChangeDisplayedHost(user,HostName);
+ if (!isnick(TypeName))
+ {
+ WriteServ(user->fd,"491 %s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick);
+ WriteOpers("*** CONFIGURATION ERROR! Oper type invalid for OperType '%s'",OperType);
+ log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host);
+ return;
+ }
strlcpy(user->oper,TypeName,NICKMAX);
found = true;
fail2 = false;