1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 06:03:12 +02:00

Fix minor linking bug which permitted a server to link in which used me::name, IF you had a link block for it. Reported by vNode1 (#4559).

This commit is contained in:
Bram Matthys
2016-01-31 20:46:52 +01:00
parent 0905936622
commit f7dd3cedd8
2 changed files with 19 additions and 1 deletions
+18
View File
@@ -336,6 +336,15 @@ skip_host_check:
if ((acptr = find_server(servername, NULL)))
{
/* Found. Bad. Quit. */
if (IsMe(acptr))
{
sendto_realops("Link %s rejected, server trying to link with my name (%s)",
get_client_name(sptr, TRUE), me.name);
sendto_one(sptr, "ERROR: Server %s exists (it's me!)", me.name);
return exit_client(sptr, sptr, sptr, "Server Exists");
}
acptr = acptr->from;
ocptr =
(cptr->local->firsttime > acptr->local->firsttime) ? acptr : cptr;
@@ -550,6 +559,15 @@ CMD_FUNC(m_server_remote)
if ((acptr = find_server(servername, NULL)))
{
/* Found. Bad. Quit. */
if (IsMe(acptr))
{
sendto_realops("Link %s rejected, server trying to link with my name (%s)",
get_client_name(sptr, TRUE), me.name);
sendto_one(sptr, "ERROR: Server %s exists (it's me!)", me.name);
return exit_client(sptr, sptr, sptr, "Server Exists");
}
acptr = acptr->from;
ocptr =
(cptr->local->firsttime > acptr->local->firsttime) ? acptr : cptr;
+1 -1
View File
@@ -97,7 +97,7 @@ aClient inline *find_server(char *name, aClient *cptr)
{
aClient *acptr;
if ((acptr = find_client(name, NULL)) != NULL && IsServer(acptr))
if ((acptr = find_client(name, NULL)) != NULL && (IsServer(acptr) || IsMe(acptr)))
return acptr;
}