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

Fixed allow::options::noident

This commit is contained in:
codemastr
2004-02-19 00:16:26 +00:00
parent 1d9301b73a
commit 05030fa603
5 changed files with 19 additions and 9 deletions
+2 -2
View File
@@ -743,7 +743,7 @@ static int check_init(aClient *cptr, char *sockn, size_t size)
* -1 = Access denied
* -2 = Bad socket.
*/
int check_client(aClient *cptr)
int check_client(aClient *cptr, char *username)
{
static char sockname[HOSTLEN + 1];
struct hostent *hp = NULL;
@@ -776,7 +776,7 @@ int check_client(aClient *cptr)
}
}
if ((i = AllowClient(cptr, hp, sockname)))
if ((i = AllowClient(cptr, hp, sockname, username)))
{
return i;
}
+13 -4
View File
@@ -2265,7 +2265,7 @@ ConfigItem_ban *Find_banEx(char *host, short type, short type2)
return NULL;
}
int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost)
int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *username)
{
ConfigItem_allow *aconf;
char *hname;
@@ -2299,7 +2299,10 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost)
* ALREADY sure that it is proper
* lengths
*/
(void)strcpy(uhost, cptr->username);
if (aconf->flags.noident)
strcpy(uhost, username);
else
(void)strcpy(uhost, cptr->username);
(void)strcat(uhost, "@");
}
else
@@ -2316,7 +2319,10 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost)
if (index(aconf->ip, '@'))
{
strncpyzt(uhost, cptr->username, sizeof(uhost));
if (aconf->flags.noident)
strncpyzt(uhost, username, sizeof(uhost));
else
strncpyzt(uhost, cptr->username, sizeof(uhost));
(void)strcat(uhost, "@");
}
else
@@ -2331,7 +2337,10 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost)
{
if (index(aconf->hostname, '@'))
{
strcpy(uhost, cptr->username);
if (aconf->flags.noident)
strcpy(uhost, username);
else
strcpy(uhost, cptr->username);
strcat(uhost, "@localhost");
}
else
+1 -1
View File
@@ -808,7 +808,7 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
if (MyConnect(sptr))
{
if ((i = check_client(sptr))) {
if ((i = check_client(sptr, username))) {
/* This had return i; before -McSkaf */
if (i == -5)
return FLUSH_BUFFER;