summaryrefslogtreecommitdiff
path: root/src/cmd_oper.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-06 16:09:29 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-06 16:09:29 +0000
commitf4a4901fee693791493c340fd380658a24d4cf26 (patch)
tree27a9d24c0d4bee19bfe0c4c33079e9e91a8b5912 /src/cmd_oper.cpp
parenta9621bc98996e08d86734e6848de13223341ea64 (diff)
Support CIDR, CIDR zline, /oper and CIDR <connect> 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
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++)