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.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd_oper.cpp b/src/cmd_oper.cpp
index 310c91266..fd71b8694 100644
--- a/src/cmd_oper.cpp
+++ b/src/cmd_oper.cpp
@@ -43,14 +43,14 @@ extern ModuleList modules;
extern FactoryList factory;
extern time_t TIME;
-bool OneOfMatches(const char* host, const char* hostlist)
+bool OneOfMatches(const char* host, const char* ip, const char* hostlist)
{
std::stringstream hl(hostlist);
std::string xhost;
while (hl >> xhost)
{
log(DEBUG,"Oper: Matching host %s",xhost.c_str());
- if (match(host,xhost.c_str()))
+ if (match(host,xhost.c_str()) || match(ip,xhost.c_str(),true))
{
return true;
}
@@ -79,7 +79,7 @@ void cmd_oper::Handle (const char** parameters, int pcnt, userrec *user)
Config->ConfValue(Config->config_data, "oper", "type", i, OperType, MAXBUF);
Config->ConfValue(Config->config_data, "oper", "host", i, HostName, MAXBUF);
- if ((!strcmp(LoginName,parameters[0])) && (!operstrcmp(Password,parameters[1])) && (OneOfMatches(TheHost,HostName)))
+ if ((!strcmp(LoginName,parameters[0])) && (!operstrcmp(Password,parameters[1])) && (OneOfMatches(TheHost,user->GetIPString(),HostName)))
{
fail2 = true;
for (j =0; j < Config->ConfValueEnum(Config->config_data, "type"); j++)