mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 17:14:46 +02:00
Did a hack on ALN
This commit is contained in:
@@ -320,4 +320,6 @@
|
||||
- Fixed a bug with /chgname with incorrect parameters to other servers
|
||||
- "Fixed" the /stats u bug?
|
||||
- Fixed +f not working (?)
|
||||
- Made the Own-protection just reduce the class maxli instead of bitching..
|
||||
- Made the Own-protection just reduce the class maxli instead of bitching..
|
||||
- Did a dirty hack on ALN problem with colliding hash (will deny linking in
|
||||
wrong servers)
|
||||
|
||||
+11
-2
@@ -443,7 +443,8 @@ int m_server(cptr, sptr, parc, parv)
|
||||
{
|
||||
char *ch;
|
||||
int i;
|
||||
char info[REALLEN + 1], *inpath, *host, *encr;
|
||||
char info[REALLEN + 1], *inpath, *host, *encr, *f;
|
||||
char pp[512];
|
||||
aClient *acptr, *bcptr;
|
||||
aConfItem *aconf, *cconf;
|
||||
int hop, ts = 0;
|
||||
@@ -566,7 +567,13 @@ int m_server(cptr, sptr, parc, parv)
|
||||
}
|
||||
/* bzero(cptr->passwd, sizeof(cptr->passwd)); */
|
||||
}
|
||||
|
||||
f = does_servername_collide(parv[1]);
|
||||
if (f)
|
||||
{
|
||||
ircsprintf(pp, "Servername %s collides with servername %s (similar hash). Change servername in some way (maybe change case)",
|
||||
parv[1], f);
|
||||
return exit_client(cptr, cptr, cptr, f);
|
||||
}
|
||||
if ((acptr = find_name(host, NULL)))
|
||||
{
|
||||
aClient *ocptr;
|
||||
@@ -607,6 +614,8 @@ int m_server(cptr, sptr, parc, parv)
|
||||
return exit_client(cptr, cptr, cptr, "Nick as Server");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (IsServer(cptr))
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -125,6 +125,24 @@ char *find_server_aln(char *s)
|
||||
return (convert2aln(hash(s)));
|
||||
|
||||
}
|
||||
|
||||
char *does_servername_collide(char *s)
|
||||
{
|
||||
int i = hash(s);
|
||||
|
||||
if (scache_hash[i])
|
||||
{
|
||||
if (strcmp(s, scache_hash[i])
|
||||
return scache_hash[i];
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Added so s_debug could check memory usage in here -Dianora
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user