From f4a4901fee693791493c340fd380658a24d4cf26 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 6 Aug 2006 16:09:29 +0000 Subject: Support CIDR, CIDR zline, /oper and CIDR tags. NOTE: With CIDR oper, ident field is not supported (yet) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4732 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_oper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cmd_oper.cpp') 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++) -- cgit v1.2.3