#include "mode.h"
#include "xline.h"
#include "inspstring.h"
-#include "dnsqueue.h"
#include "helperfuncs.h"
#include "hashcomp.h"
#include "socketengine.h"
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;
}
char TypeName[MAXBUF];
char HostName[MAXBUF];
char TheHost[MAXBUF];
+ char TheIP[MAXBUF];
int j;
bool found = false;
bool fail2 = false;
snprintf(TheHost,MAXBUF,"%s@%s",user->ident,user->host);
+ snprintf(TheIP, MAXBUF,"%s@%s",user->ident,user->GetIPString());
for (int i = 0; i < Config->ConfValueEnum(Config->config_data, "oper"); i++)
{
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,TheIP,HostName)))
{
fail2 = true;
for (j =0; j < Config->ConfValueEnum(Config->config_data, "type"); j++)