1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-30 03:56:39 +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
+1
View File
@@ -2902,3 +2902,4 @@ seen. gmtime warning still there
if you added an invalid regex. Reported by Tony (#0001556).
- Fixed the problem with services and SETHOST for unknown user errors
(#0000893) reported by vorte[x]
- Made allow::options::noident work correctly (#0001416) reported by Zifnab
+2 -2
View File
@@ -129,7 +129,7 @@ ConfigItem_vhost *Find_vhost(char *name);
ConfigItem_deny_channel *Find_channel_allowed(char *name);
ConfigItem_alias *Find_alias(char *name);
ConfigItem_help *Find_Help(char *command);
int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost);
int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *username);
int parse_netmask(const char *text, struct IN_ADDR *addr, int *b);
int match_ipv4(struct IN_ADDR *addr, struct IN_ADDR *mask, int b);
#ifdef INET6
@@ -231,7 +231,7 @@ extern int readcalls, udpfd, resfd;
extern aClient *add_connection(aClient *, int);
extern int add_listener(aConfItem *);
extern void add_local_domain(char *, int);
extern int check_client(aClient *);
extern int check_client(aClient *, char *);
extern int check_server(aClient *, struct hostent *, aConfItem *,
aConfItem *, int);
extern int check_server_init(aClient *);
+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;