summaryrefslogtreecommitdiff
path: root/src/cmd_oper.cpp
diff options
context:
space:
mode:
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;