- Fixed an old bug where allow::hostname localhost (or *@localhost) didn't work ().

This commit is contained in:
Bram Matthys 2003-09-05 20:38:52 +00:00
parent 0475c6b874
commit 8bfcc56c9e
2 changed files with 18 additions and 0 deletions

View file

@ -2395,3 +2395,4 @@ seen. gmtime warning still there
- Fixed a double OperOverride notice bug reported by DukePyrolator (#0001180).
- Doc fixes/updates reported by Angrywolf (#0001163, #0001176).
- Fixed a /rehash crash regarding badword all & regex badwords, reported by Angrywolf (#0001230).
- Fixed an old bug where allow::hostname localhost (or *@localhost) didn't work (#0001115).

View file

@ -2246,6 +2246,23 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost)
(void)strncat(uhost, sockhost, sizeof(uhost) - strlen(uhost));
if (!match(aconf->ip, uhost))
goto attach;
/* Hmm, localhost is a special case, hp == NULL and sockhost contains
* 'localhost' instead of an ip... -- Syzop. */
if (!strcmp(sockhost, "localhost"))
{
if (index(aconf->hostname, '@'))
{
strcpy(uhost, cptr->username);
strcat(uhost, "@localhost");
}
else
strcpy(uhost, "localhost");
if (!match(aconf->hostname, uhost))
goto attach;
}
continue;
attach:
/* if (index(uhost, '@')) now flag based -- codemastr */