mirror of
https://github.com/anope/anope.git
synced 2026-07-06 10:33:12 +02:00
Fixed bug #1106 - Anope now keeps track of users cloaked hosts as well as virtual host and will use both in matching for things
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2679 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -2,24 +2,25 @@ Anope Version 1.8 SVN
|
||||
-------------------
|
||||
Provided by Anope Dev. <team@anope.org> - 2009
|
||||
10/05 A Added InspIRCd 1.2 support. [ #00]
|
||||
07/31 F Fixed anope sending umode change using channels' syntax. [ #00]
|
||||
07/31 F Fixed TS6 UUID issue while parsing modechanges. [ #00]
|
||||
08/01 F Fixed several memory leaks in HostServ. [ #00]
|
||||
08/01 F Fixed several memory leaks in HostServ. [ #00]
|
||||
08/03 F Fixed TS6 SID issue when introducing new servers. [ #00]
|
||||
08/19 F Fixed NS SASET displaying wrong language. [#1094]
|
||||
08/24 F Fixed entry_match() failing when given no username. [ #00]
|
||||
11/27 F Fixed tracking of users host when they disable their vhost [#1106]
|
||||
11/25 F Fixed a bug in CLEAR OPS causing incorrect mode removal. [#1114]
|
||||
11/25 F Fixed a number of major XOP related issues. [ #00]
|
||||
10/06 F Fixed CS FORBID not clearing excepts & invites. [#1097]
|
||||
09/09 F Fixed number of TS6 compatibility issues. [#1096]
|
||||
08/30 F Fixed MLOCK superseding DEFCON mode lock. [ #00]
|
||||
08/29 F Fixed defcon failing to set and remove modes. [#1101]
|
||||
08/27 F Fixed NS SUSPEND not being shown to services opers. [#1099]
|
||||
08/27 F Fixed NS UNSUSPEND not being shown to services opers. [#1100]
|
||||
08/27 F Fixed services sending no or wrong help to opers. [#1102]
|
||||
08/27 F Fixed services sending no or wrong help to opers. [#1103]
|
||||
08/27 F Fixed services sending no or wrong help to opers. [#1104]
|
||||
08/29 F Fixed defcon failing to set and remove modes. [#1101]
|
||||
08/30 F Fixed MLOCK superseding DEFCON mode lock. [ #00]
|
||||
09/09 F Fixed number of TS6 compatibility issues. [#1096]
|
||||
10/06 F Fixed CS FORBID not clearing excepts & invites. [#1097]
|
||||
11/25 F Fixed a number of major XOP related issues. [ #00]
|
||||
11/25 F Fixed a bug in CLEAR OPS causing incorrect mode removal. [#1114]
|
||||
08/24 F Fixed entry_match() failing when given no username. [ #00]
|
||||
08/19 F Fixed NS SASET displaying wrong language. [#1094]
|
||||
08/03 F Fixed TS6 SID issue when introducing new servers. [ #00]
|
||||
08/01 F Fixed several memory leaks in HostServ. [ #00]
|
||||
08/01 F Fixed several memory leaks in HostServ. [ #00]
|
||||
07/31 F Fixed anope sending umode change using channels' syntax. [ #00]
|
||||
07/31 F Fixed TS6 UUID issue while parsing modechanges. [ #00]
|
||||
|
||||
Provided by Han` <Han@mefalcon.org> - 2009
|
||||
07/28 F Updated german language file. [ #00]
|
||||
|
||||
@@ -870,6 +870,7 @@ struct user_ {
|
||||
char *host; /* User's real hostname */
|
||||
char *hostip; /* User's IP number */
|
||||
char *vhost; /* User's virtual hostname */
|
||||
char *chost; /* User's cloaked hostname */
|
||||
char *vident; /* User's virtual ident */
|
||||
char *realname; /* Realname */
|
||||
Server *server; /* Server user is connected to */
|
||||
|
||||
+5
-4
@@ -181,7 +181,8 @@ void common_unban(ChannelInfo * ci, char *nick)
|
||||
for (ban = ci->c->bans->entries; ban; ban = next) {
|
||||
next = ban->next;
|
||||
if (entry_match(ban, u->nick, u->username, u->host, ip) ||
|
||||
entry_match(ban, u->nick, u->username, u->vhost, ip)) {
|
||||
entry_match(ban, u->nick, u->username, u->vhost, ip) ||
|
||||
entry_match(ban, u->nick, u->username, u->chost, ip)) {
|
||||
anope_cmd_mode(whosends(ci), ci->name, "-b %s", ban->mask);
|
||||
if (ircdcap->tsmode)
|
||||
av[3] = ban->mask;
|
||||
@@ -240,10 +241,10 @@ char *common_get_vhost(User * u)
|
||||
if (!u)
|
||||
return NULL;
|
||||
|
||||
if (ircd->vhostmode && (u->mode & ircd->vhostmode))
|
||||
return u->vhost;
|
||||
else if (ircd->vhost && u->vhost)
|
||||
if (ircd->vhostmode && (u->mode & ircd->vhostmode) && u->vhost)
|
||||
return u->vhost;
|
||||
else if (ircd->vhostmode && (u->mode & ircd->vhostmode) && u->chost)
|
||||
return u->chost;
|
||||
else
|
||||
return u->host;
|
||||
}
|
||||
|
||||
+5
-1
@@ -75,8 +75,12 @@ int do_off(User * u)
|
||||
vident = getvIdent(u->nick);
|
||||
if (vhost == NULL && vident == NULL)
|
||||
notice_lang(s_HostServ, u, HOST_NOT_ASSIGNED);
|
||||
else
|
||||
else {
|
||||
anope_cmd_vhost_off(u);
|
||||
if (u->vhost)
|
||||
free(u->vhost);
|
||||
u->vhost = NULL;
|
||||
}
|
||||
} else {
|
||||
notice_lang(s_HostServ, u, HOST_ID);
|
||||
}
|
||||
|
||||
+15
-7
@@ -1281,8 +1281,7 @@ NickCore *findcore(const char *nick)
|
||||
int is_on_access(User * u, NickCore * nc)
|
||||
{
|
||||
int i;
|
||||
char *buf;
|
||||
char *buf2 = NULL;
|
||||
char *buf, *buf2 = NULL, *buf3 = NULL;
|
||||
|
||||
if (nc->accesscount == 0)
|
||||
return 0;
|
||||
@@ -1294,24 +1293,33 @@ int is_on_access(User * u, NickCore * nc)
|
||||
buf2 = scalloc(strlen(u->username) + strlen(u->vhost) + 2, 1);
|
||||
sprintf(buf2, "%s@%s", u->username, u->vhost);
|
||||
}
|
||||
if (u->chost)
|
||||
{
|
||||
buf3 = scalloc(strlen(u->username) + strlen(u->chost) + 2, 1);
|
||||
sprintf(buf2, "%s@%s", u->username, u->chost);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nc->accesscount; i++) {
|
||||
if (match_wild_nocase(nc->access[i], buf)
|
||||
|| (ircd->vhost ? match_wild_nocase(nc->access[i], buf2) : 0)) {
|
||||
if (match_wild_nocase(nc->access[i], buf) || (buf2 && match_wild_nocase(nc->access[i], buf2)) || (buf3 && match_wild_nocase(nc->access[i], buf3)))
|
||||
{
|
||||
free(buf);
|
||||
if (ircd->vhost) {
|
||||
if (u->vhost) {
|
||||
free(buf2);
|
||||
}
|
||||
if (u->chost)
|
||||
free(buf3);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
if (ircd->vhost) {
|
||||
free(buf2);
|
||||
}
|
||||
if (buf2)
|
||||
free(buf2);
|
||||
if (buf3)
|
||||
free(buf3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -668,7 +668,7 @@ void rageircd_cmd_topic(char *whosets, char *chan, char *whosetit,
|
||||
|
||||
void rageircd_cmd_vhost_off(User * u)
|
||||
{
|
||||
send_cmd(s_HostServ, "SVSMODE %s -x", u->nick);
|
||||
common_svsmode(u, "-x", NULL);
|
||||
notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar);
|
||||
}
|
||||
|
||||
|
||||
@@ -1388,7 +1388,7 @@ void solidircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
|
||||
|
||||
void solidircd_cmd_vhost_off(User * u)
|
||||
{
|
||||
send_cmd(s_HostServ, "SVSMODE %s -v", u->nick);
|
||||
common_svsmode(u, "-v", NULL);
|
||||
notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar);
|
||||
}
|
||||
|
||||
|
||||
@@ -720,7 +720,7 @@ void ultimate3_cmd_remove_akill(char *user, char *host)
|
||||
|
||||
void ultimate3_cmd_vhost_off(User * u)
|
||||
{
|
||||
send_cmd(s_HostServ, "SVSMODE %s -x", u->nick);
|
||||
common_svsmode(u, "-x", NULL);
|
||||
notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar);
|
||||
}
|
||||
|
||||
|
||||
@@ -424,6 +424,12 @@ void unreal_set_umode(User * user, int ac, char **av)
|
||||
}
|
||||
break;
|
||||
case 'x':
|
||||
if (!add)
|
||||
{
|
||||
if (user->vhost)
|
||||
free(user->vhost);
|
||||
user->vhost = NULL;
|
||||
}
|
||||
update_host(user);
|
||||
break;
|
||||
}
|
||||
@@ -518,7 +524,8 @@ void unreal_cmd_topic(char *whosets, char *chan, char *whosetit,
|
||||
|
||||
void unreal_cmd_vhost_off(User * u)
|
||||
{
|
||||
send_cmd(s_HostServ, "SVSMODE %s -xt", u->nick);
|
||||
common_svsmode(u, "-xt", NULL);
|
||||
common_svsmode(u, "+x", NULL);
|
||||
notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar);
|
||||
}
|
||||
|
||||
|
||||
+8
-11
@@ -489,6 +489,12 @@ void unreal_set_umode(User * user, int ac, char **av)
|
||||
}
|
||||
break;
|
||||
case 'x':
|
||||
if (!add)
|
||||
{
|
||||
if (user->vhost)
|
||||
free(user->vhost);
|
||||
user->vhost = NULL;
|
||||
}
|
||||
update_host(user);
|
||||
break;
|
||||
}
|
||||
@@ -532,18 +538,9 @@ void unreal_cmd_topic(char *whosets, char *chan, char *whosetit,
|
||||
|
||||
void unreal_cmd_vhost_off(User * u)
|
||||
{
|
||||
if (UseSVS2MODE) {
|
||||
send_cmd(s_HostServ, "%s %s -xt", send_token("SVS2MODE", "v"),
|
||||
u->nick);
|
||||
send_cmd(s_HostServ, "%s %s +x", send_token("SVS2MODE", "v"),
|
||||
u->nick);
|
||||
} else {
|
||||
send_cmd(s_HostServ, "%s %s -xt", send_token("SVSMODE", "n"),
|
||||
u->nick);
|
||||
send_cmd(s_HostServ, "%s %s +x", send_token("SVSMODE", "n"),
|
||||
u->nick);
|
||||
common_svsmode(u, "-xt", NULL);
|
||||
common_svsmode(u, "+x", NULL);
|
||||
|
||||
}
|
||||
notice_lang(s_HostServ, u, HOST_OFF);
|
||||
}
|
||||
|
||||
|
||||
@@ -812,7 +812,7 @@ void viagra_cmd_topic(char *whosets, char *chan, char *whosetit,
|
||||
|
||||
void viagra_cmd_vhost_off(User * u)
|
||||
{
|
||||
send_cmd(NULL, "SVSMODE %s -x", u->nick);
|
||||
common_svsmode(u, "-x", NULL);
|
||||
notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar);
|
||||
}
|
||||
|
||||
|
||||
+14
-2
@@ -224,6 +224,8 @@ void delete_user(User * user)
|
||||
alog("debug: delete_user(): free user data");
|
||||
free(user->username);
|
||||
free(user->host);
|
||||
if (user->chost)
|
||||
free(user->chost);
|
||||
if (user->vhost)
|
||||
free(user->vhost);
|
||||
if (user->vident)
|
||||
@@ -633,6 +635,14 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
|
||||
user->realname = sstrdup(realname);
|
||||
user->timestamp = ts;
|
||||
user->my_signon = time(NULL);
|
||||
/* Initially set both the vhost and cloaked host to the users cloaked host, vhost will be changed
|
||||
* later if they get a real vhost, chost however should *never* be changed to anything else.
|
||||
* It is possible that on most IRCds (Unreal) a server splits and then comes back, reintroducing clients
|
||||
* with a vhost (not a cloaked host) and never informing Anope about the real cloaked host. For now I'm
|
||||
* leaving this open (we should prboably request a USERHOST or so) as this won't occur that much, and any
|
||||
* fixes to this problem are ugly. - Adam
|
||||
*/
|
||||
user->chost = vhost ? sstrdup(vhost) : sstrdup(host);
|
||||
user->vhost = vhost ? sstrdup(vhost) : sstrdup(host);
|
||||
if (uid) {
|
||||
user->uid = sstrdup(uid); /* p10/ts6 stuff */
|
||||
@@ -1002,11 +1012,13 @@ int match_usermask(const char *mask, User * user)
|
||||
result = match_wild_nocase(nick, user->nick)
|
||||
&& match_wild_nocase(username, user->username)
|
||||
&& (match_wild_nocase(host, user->host)
|
||||
|| match_wild_nocase(host, user->vhost));
|
||||
|| match_wild_nocase(host, user->vhost)
|
||||
|| match_wild_nocase(host, user->chost));
|
||||
} else {
|
||||
result = match_wild_nocase(username, user->username)
|
||||
&& (match_wild_nocase(host, user->host)
|
||||
|| match_wild_nocase(host, user->vhost));
|
||||
|| match_wild_nocase(host, user->vhost)
|
||||
|| match_wild_nocase(host, user->chost));
|
||||
}
|
||||
|
||||
free(mask2);
|
||||
|
||||
+2
-1
@@ -9,9 +9,10 @@ VERSION_MAJOR="1"
|
||||
VERSION_MINOR="8"
|
||||
VERSION_PATCH="2"
|
||||
VERSION_EXTRA="-svn"
|
||||
VERSION_BUILD="2671"
|
||||
VERSION_BUILD="2679"
|
||||
|
||||
# $Log$ # Changes since 1.8.2 Release
|
||||
#Revision 2679 - Fixed bug #1106 - Anope now keeps track of users cloaked hosts as well as virtual host and will use both in matching for things
|
||||
#Revision 2671 - Fix bug #1114. Fixed a bug in cs_clear caused by do_cmode() modifying params passed to it. Also fixed some warnings in cs_xop.
|
||||
#Revision 2668 - Fix a few more XOP related problems.
|
||||
#Revision 2667 - Cleaned up a lot of the channel access reordering code, properly change users with less than voice access on channels to XOP, and fix a potential crashbug after switching to XOP on IRCds that do not support halfop
|
||||
|
||||
Reference in New Issue
Block a user