diff options
| author | rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-02-12 10:11:23 +0000 |
|---|---|---|
| committer | rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-02-12 10:11:23 +0000 |
| commit | 66248d41ff0a8e1fa8d02160ef42dab6955dd6ef (patch) | |
| tree | 12ecfce024f5cbaea70fb3b4b23869b117f0cabb /src/actions.c | |
| parent | a3e5ec9638c4f4c6ea08140e200f370e09f6cb6c (diff) | |
Applied patches by neno and trystan
git-svn-id: svn://svn.anope.org/anope/trunk@966 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@691 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/actions.c')
| -rw-r--r-- | src/actions.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/actions.c b/src/actions.c index e9c70ae52..c9ca020a0 100644 --- a/src/actions.c +++ b/src/actions.c @@ -134,6 +134,7 @@ void common_unban(ChannelInfo * ci, char *nick) char *av[3], **bans; User *u; char *host; + int matchfound = 0; if (!ci || !ci->c || !nick) { return; @@ -158,19 +159,34 @@ void common_unban(ChannelInfo * ci, char *nick) anope_cmd_mode(whosends(ci), ci->name, "-b %s", bans[i]); av[2] = bans[i]; do_cmode(whosends(ci), 3, av); + matchfound++; } if (host) { - if (match_userip(bans[i], u, host)) { + /* prevent multiple unbans if the first one was successful in + locating the ban for us. This is due to match_userip() checks + the vhost again, and thus can return false positive results + for the function. but won't prevent thus from clearing out + the bans against an IP address since the first would fail and + the second would match - TSL + */ + if (!matchfound) { + if (match_userip(bans[i], u, host)) { anope_cmd_mode(whosends(ci), ci->name, "-b %s", bans[i]); av[2] = bans[i]; do_cmode(whosends(ci), 3, av); + } } } + matchfound = 0; } free(bans); free(av[1]); } + /* host_resolve() sstrdup us this info so we gotta free it */ + if (host) { + free(host); + } } /*************************************************************************/ |
