From 1d27423b182f696966d8095e4e5e727b7ced3df1 Mon Sep 17 00:00:00 2001 From: w00t Date: Sat, 17 Jun 2006 11:19:50 +0000 Subject: Hopefully we now have hostmask matching on both vhost and host. git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@4022 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_check.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/modules/m_check.cpp') diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 0466f8f50..3ab31ebbc 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -27,6 +27,7 @@ using namespace std; /* $ModDesc: Provides the /check command to retrieve information on a user, channel, or IP address */ extern user_hash clientlist; +extern bool match(const char *, const char *); static Server *Srv; @@ -162,6 +163,14 @@ class cmd_check : public command_t if (inet_aton(parameters[0], &addr.sin_addr) == 0) { /* hostname or other */ + for (user_hash::const_iterator a = clientlist.begin(); a != clientlist.end(); a++) + { + if (match(a->second->host, parameters[0]) || match(a->second->dhost, parameters[0])) + { + /* host or vhost matches mask */ + Srv->SendTo(NULL, user, checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost()); + } + } } else { -- cgit v1.3.1-10-gc9f91