1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 09:03:13 +02:00

BUILD : 1.7.21 (1426) BUGS : 876 NOTES : We now support CIDR in channel ban/invite/except lists. Introduces new CIDR capable generic lists system.

git-svn-id: svn://svn.anope.org/anope/trunk@1426 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1141 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b
2008-09-03 20:11:12 +00:00
parent 482a8aa766
commit 790dc8a4bf
30 changed files with 861 additions and 353 deletions
+9 -41
View File
@@ -506,7 +506,7 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
if (!strcmp(vhost, "*")) {
vhost = NULL;
if (debug)
alog("debug: new user with no vhost in NICK command: %s", nick);
alog("debug: new userwith no vhost in NICK command: %s", nick);
}
}
}
@@ -921,30 +921,13 @@ int is_oper(User * user)
/* Is the given user ban-excepted? */
int is_excepted(ChannelInfo * ci, User * user)
{
int count, i;
int isexcepted = 0;
char **excepts;
if (!ci->c)
if (!ci->c || !ircd->except)
return 0;
if (!ircd->except) {
return 0;
}
if (elist_match_user(ci->c->excepts, user))
return 1;
count = ci->c->exceptcount;
excepts = scalloc(sizeof(char *) * count, 1);
memcpy(excepts, ci->c->excepts, sizeof(char *) * count);
for (i = 0; i < count; i++) {
if (match_usermask(excepts[i], user)
|| match_userip(excepts[i], user, user->hostip)) {
isexcepted = 1;
break;
}
}
free(excepts);
return isexcepted;
return 0;
}
/*************************************************************************/
@@ -952,28 +935,13 @@ int is_excepted(ChannelInfo * ci, User * user)
/* Is the given MASK ban-excepted? */
int is_excepted_mask(ChannelInfo * ci, char *mask)
{
int count, i;
int isexcepted = 0;
char **excepts;
if (!ci->c)
if (!ci->c || !ircd->except)
return 0;
if (!ircd->except) {
return 0;
}
if (elist_match_mask(ci->c->excepts, mask, 0))
return 1;
count = ci->c->exceptcount;
excepts = scalloc(sizeof(char *) * count, 1);
memcpy(excepts, ci->c->excepts, sizeof(char *) * count);
for (i = 0; i < count; i++) {
if (match_wild_nocase(excepts[i], mask)) {
isexcepted = 1;
}
}
free(excepts);
return isexcepted;
return 0;
}