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:
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user