summaryrefslogtreecommitdiff
path: root/src/commands.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-22 15:10:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-22 15:10:11 +0000
commit30b22d2b48ecdeac906c69fb28d6df2ef782f792 (patch)
treef0ee3f773cabcd79b34a440910c364e49e090bea /src/commands.cpp
parent56aff87a0c71c2b5af26dcc754391307594572b1 (diff)
Added OnOperCompare function to override strcmp in password check for /oper
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1161 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 7093386aa..db2cd3624 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1605,7 +1605,16 @@ bool is_uline(const char* server)
}
return false;
}
-
+int operstrcmp(char* data,char* input)
+{
+ int MOD_RESULT = 0;
+ FOREACH_RESULT(OnOperCompare(data,input))
+ if (MOD_RESULT == 1)
+ return 0;
+ if (MOD_RESULT == -1)
+ return 1;
+ return strcmp(data,input);
+}
void handle_oper(char **parameters, int pcnt, userrec *user)
{
@@ -1628,7 +1637,7 @@ void handle_oper(char **parameters, int pcnt, userrec *user)
ConfValue("oper","password",i,Password,&config_f);
ConfValue("oper","type",i,OperType,&config_f);
ConfValue("oper","host",i,HostName,&config_f);
- if ((!strcmp(LoginName,parameters[0])) && (!strcmp(Password,parameters[1])) && (match(TheHost,HostName)))
+ if ((!strcmp(LoginName,parameters[0])) && (!operstrcmp(Password,parameters[1])) && (match(TheHost,HostName)))
{
fail2 = true;
for (j =0; j < ConfValueEnum("type",&config_f); j++)