diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-09-12 03:32:47 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-09-12 03:32:47 +0000 |
commit | 7ea66a37d56ef46726bcca6c8a6f2685cbbceafb (patch) | |
tree | 257f249009bf07167645d679049bbca2d55cabf4 /src/nickserv.c | |
parent | 46030bbc7e4ca72fd35dd1d5fa272c3c91d8324a (diff) |
Fixes bugs #1105 and #1106
Now properly track users host changes and keep users cloaked hosts saved in memory
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2498 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/nickserv.c')
-rw-r--r-- | src/nickserv.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nickserv.c b/src/nickserv.c index 555c18de1..01c90a07e 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -949,6 +949,7 @@ int is_on_access(User * u, NickCore * nc) unsigned i; char *buf; char *buf2 = NULL; + char *buf3 = NULL; if (nc->access.empty()) return 0; @@ -962,13 +963,17 @@ int is_on_access(User * u, NickCore * nc) buf2 = new char[u->GetIdent().length() + strlen(u->vhost) + 2]; sprintf(buf2, "%s@%s", u->GetIdent().c_str(), u->vhost); } + if (!u->GetCloakedHost().empty()) + { + buf3 = new char[u->GetIdent().length() + u->GetCloakedHost().length() + 2]; + sprintf(buf3, "%s@%s", u->GetIdent().c_str(), u->GetCloakedHost().c_str()); + } } for (i = 0; i < nc->access.size(); i++) { std::string access = nc->GetAccess(i); - if (Anope::Match(buf, access, false) - || (ircd->vhost ? Anope::Match(buf2, access, false) : 0)) + if (Anope::Match(buf, access, false) || (buf2 && Anope::Match(buf2, access, false)) || (buf3 && Anope::Match(buf3, access, false))) { delete [] buf; if (ircd->vhost) @@ -977,6 +982,10 @@ int is_on_access(User * u, NickCore * nc) { delete [] buf2; } + if (!u->GetCloakedHost().empty()) + { + delete [] buf3; + } } return 1; } @@ -985,6 +994,7 @@ int is_on_access(User * u, NickCore * nc) if (ircd->vhost) { delete [] buf2; + delete [] buf3; } return 0; } |