1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 23:06:40 +02:00

Fixed do_server() so it doesn't go nuts if a SID is the source. Added some sanity checks and debug output as well.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2402 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
jantje_85
2009-08-03 17:25:32 +00:00
parent 2bd483c273
commit b13836f3cf
3 changed files with 23 additions and 12 deletions
+2
View File
@@ -4,6 +4,8 @@ Provided by Anope Dev. <team@anope.org> - 2009
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]
Provided by Han` <Han@mefalcon.org> - 2009
07/28 F Updated german language file. [ #00]
+19 -11
View File
@@ -122,6 +122,10 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
{
Server *serv;
if (debug)
alog("debug: Creating %s(%s) uplinked to %s", name, suid ? suid : "",
uplink ? uplink->name : "No uplink");
serv = scalloc(sizeof(Server), 1);
if (!name)
name = "";
@@ -155,10 +159,10 @@ Server *new_server(Server * uplink, const char *name, const char *desc,
uplink->links = serv;
}
/* Check if this is our uplink server */
if ((uplink == me_server) && !(flags & SERVER_JUPED)) {
if ((uplink == me_server) && !(flags & SERVER_JUPED)) {
serv_uplink = serv;
serv->flags |= SERVER_ISUPLINK;
}
serv->flags |= SERVER_ISUPLINK;
}
/* Write the StartGlobal (to non-juped servers) */
if (GlobalOnCycle && GlobalOnCycleUP && !(flags & SERVER_JUPED))
@@ -186,14 +190,15 @@ static void delete_server(Server * serv, const char *quitreason)
NickAlias *na;
if (!serv) {
if (debug) {
if (debug)
alog("debug: delete_server() called with NULL arg!");
}
return;
}
if (debug)
alog("debug: delete_server() called for %s", serv->name);
alog("debug: Deleting %s(%s) uplinked to %s(%s)", serv->name,
serv->suid ? serv->suid : "", serv->uplink ? serv->uplink->name : "???",
serv->uplink ? serv->uplink->suid : "");
if (ircdcap->noquit || ircdcap->qs) {
if ((uplink_capab & ircdcap->noquit)
@@ -366,12 +371,18 @@ void do_server(const char *source, char *servername, char *hops,
source);
}
}
if (source[0] == '\0')
s = me_server;
else
else if (UseTS6 && ircd->ts6) {
s = findserver_uid(servlist, source);
if (!s)
s = findserver(servlist, source);
} else
s = findserver(servlist, source);
if (!s)
fatal("FATAL ERROR: Received new server from nonexistant uplink.");
new_server(s, servername, descript, 0, numeric);
send_event(EVENT_SERVER_CONNECT, 1, servername);
}
@@ -573,9 +584,6 @@ static unsigned int ts6_uid_index = 9; /* last slot in uid buf */
void ts6_uid_init(void)
{
unsigned int i;
char buf[BUFSIZE];
/* check just in case... you can never be too safe. */
if (TS6SID != NULL) {
snprintf(ts6_new_uid, 10, "%sAAAAAA", TS6SID);
+2 -1
View File
@@ -9,9 +9,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="2"
VERSION_EXTRA="-svn"
VERSION_BUILD="2401"
VERSION_BUILD="2402"
# $Log$ # Changes since 1.8.2 Release
#Revision 2402 - Fixed do_server() so it doesn't go nuts if a SID is the source. Added some sanity checks and debug output as well.
#Revision 2401 - Added forgotten entries to version.log and Changes, some code cleanup and fixed a few minor TS6 issues.
#Revision 2400 - Fixed some memory leaks when setting vhosts on users.
#Revision 2398 - Fixed a TS6 bug in chan_set_modes() causing restrictions such as secureops to fail if the IRCd sends UUIDs instead of nicks.