1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 13:16:38 +02:00

BUILD : 1.7.8 (765) BUGS : 352 NOTES : Fixed various PTlink vhost handling bugs. Added a fake umode to indicate we have a vHost, to not break other IRCDs which DO use umodes. Ignoring PTlinks NEWMASK on SVSMODE +r, as that would desynch the services internal vhost.

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


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@526 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b
2005-05-04 11:17:29 +00:00
parent a075334df1
commit 96832f34e7
5 changed files with 50 additions and 46 deletions
+1
View File
@@ -25,6 +25,7 @@ Provided by Anope Dev. <dev@anope.org> - 2005
02/13 A Internal Event support, see EVENTS in the doc folder for help [ #00]
02/05 A Support for Unreal 3.2 +I channel mode. [ #00]
02/03 A Merged anope-win32 branch into the main, now Win32 ready. [ #00]
05/04 F vHost handling with PTlink was broken in a subtle way. [#352]
05/04 F Missing check for valid ChannelInfo in topic handling. [#363]
05/04 F Module language texts sometimes being mixed. [ #00]
05/04 F Wrong datatype in the config parser for OSInfoDBName. [ #00]
+11 -43
View File
@@ -207,23 +207,13 @@ void common_svsmode(User * u, char *modes, char *arg)
*/
char *common_get_vhost(User * u)
{
if (!u) {
if (!u)
return NULL;
}
if (ircd->vhostmode) {
if (u->mode & ircd->vhostmode) {
return u->vhost;
/* ptlink hack since there is no user mode
for vhost, simply compare the host to the
vhost struct memember */
} else if (stricmp(u->vhost, u->host)) {
return u->vhost;
} else {
return u->host;
}
} else {
if (ircd->vhostmode && (u->mode & ircd->vhostmode))
return u->vhost;
else
return u->host;
}
}
/*************************************************************************/
@@ -236,33 +226,11 @@ char *common_get_vhost(User * u)
*/
char *common_get_vident(User * u)
{
if (!u) {
if (!u)
return NULL;
}
if (ircd->vhostmode) {
if (u->mode & ircd->vhostmode) {
return u->vident;
/* ptlink hack since there is no user mode
for vhost, simply compare the host to the
vhost struct memember */
} else if (u->vident) {
if (stricmp(u->vident, u->username)) {
return u->vident;
} else {
return u->username;
}
} else {
return u->username;
}
} else {
if (u->vident) {
if (stricmp(u->vident, u->username)) {
return u->vident;
} else {
return u->username;
}
} else {
return u->username;
}
}
if (ircd->vhostmode && (u->mode & ircd->vhostmode))
return u->vident;
else
return u->username;
}
+30 -2
View File
@@ -79,7 +79,7 @@ IRCDVar myIrcd[] = {
CMODE_K, /* No Knock */
CMODE_A, /* Admin Only */
DEFAULT_MLOCK, /* Default MLOCK */
UMODE_o, /* Vhost Mode */
UMODE_VH, /* Vhost Mode */
1, /* +f */
0, /* +L */
CMODE_f,
@@ -429,6 +429,18 @@ int anope_event_newmask(char *source, int ac, char **av)
}
return MOD_CONT;
}
if ((u->mode & (UMODE_NM | UMODE_VH)) == (UMODE_NM | UMODE_VH)) {
/* This NEWMASK should be discarded because it's sent due to a +r by
* someone with a ptlink-masked host. PTlink has our correct host, so
* we can just ignore this :) Or we'll get ptlink's old host which is
* not what we want. -GD
*/
u->mode &= ~UMODE_NM;
if (debug)
alog("debug: Ignoring NEWMASK because it's send because of SVSMODE +r");
return MOD_CONT;
}
newuser = myStrGetOnlyToken(av[0], '@', 0);
if (newuser) {
@@ -440,7 +452,9 @@ int anope_event_newmask(char *source, int ac, char **av)
if (*newhost == '@')
newhost++;
u->mode |= UMODE_VH;
if (newhost) {
change_user_host(u, newhost);
}
@@ -699,6 +713,15 @@ void ptlink_cmd_svsmode(User * u, int ac, char **av)
{
send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0],
(ac == 2 ? " " : ""), (ac == 2 ? av[1] : ""));
/* If we set +r on someone +NRah (1 or more of those modes), PTlink will
* send us a NEWMASK with their ptlink-masked-host. If we want HostServ
* to work for them, we will need to send our NEWMASK after we receive
* theirs. Thus we make a hack and store in moduleData that we need to
* look out for that.
*/
if (strchr(av[0], 'r') && (u->mode & UMODE_N) || (u->mode & UMODE_R) || (u->mode & UMODE_a) || (u->mode & UMODE_h))
u->mode |= UMODE_NM;
}
int anope_event_error(char *source, int ac, char **av)
@@ -1180,11 +1203,16 @@ void ptlink_cmd_vhost_off(User * u)
void ptlink_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
{
User *u;
if (vIdent) {
send_cmd(s_HostServ, "NEWMASK %s@%s %s", vIdent, vhost, nick);
} else {
send_cmd(s_HostServ, "NEWMASK %s %s", vhost, nick);
}
if ((u = finduser(nick)))
u->mode |= UMODE_VH;
}
/* INVITE */
+3
View File
@@ -31,6 +31,9 @@
#define UMODE_y 0x00002000
#define UMODE_z 0x00004000
#define UMODE_VH 0x00008000 /* Fake umode used for internal vhost things */
#define UMODE_NM 0x00010000 /* Fake umode used for internal NEWMASK things */
/* Let's hope for a better vhost-system with PTlink7 ;) */
#define CMODE_i 0x00000001
+5 -1
View File
@@ -8,10 +8,14 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="8"
VERSION_BUILD="764"
VERSION_BUILD="765"
# $Log$
#
# BUILD : 1.7.8 (765)
# BUGS : 352
# NOTES : Fixed various PTlink vhost handling bugs. Added a fake umode to indicate we have a vHost, to not break other IRCDs which DO use umodes. Ignoring PTlinks NEWMASK on SVSMODE +r, as that would desynch the services internal vhost.
#
# BUILD : 1.7.8 (764)
# BUGS : 363
# NOTES : Missing (c->)ci check in do_topic(), causing segfaults...