*/
int
-register_local_user(struct Client *client_p, struct Client *source_p, const char *username)
+register_local_user(struct Client *client_p, struct Client *source_p)
{
struct ConfItem *aconf, *xconf;
struct User *user = source_p->user;
s_assert(NULL != source_p);
s_assert(MyConnect(source_p));
- s_assert(source_p->username != username);
if(source_p == NULL)
return -1;
client_p->localClient->last = rb_current_time();
/* XXX - fixme. we shouldnt have to build a users buffer twice.. */
- if(!IsGotId(source_p) && (strchr(username, '[') != NULL))
+ if(!IsGotId(source_p) && (strchr(source_p->username, '[') != NULL))
{
const char *p;
int i = 0;
- p = username;
+ p = source_p->username;
while(*p && i < USERLEN)
{
}
myusername[i] = '\0';
- username = myusername;
}
+ else
+ strlcpy(myusername, source_p->username, sizeof myusername);
- if((status = check_client(client_p, source_p, username)) < 0)
+ if((status = check_client(client_p, source_p, myusername)) < 0)
return (CLIENT_EXITED);
/* Apply nick override */
/* dont replace username if its supposed to be spoofed --fl */
if(!IsConfDoSpoofIp(aconf) || !strchr(aconf->info.name, '@'))
{
- p = username;
+ p = myusername;
if(!IsNoTilde(aconf))
source_p->username[i++] = '~';
char *p;
hook_data_umode_changed hdata;
hook_data_client hdata2;
- char sockhost[HOSTLEN];
if(MyClient(source_p))
- send_umode(source_p, source_p, 0, 0, ubuf);
+ send_umode(source_p, source_p, 0, ubuf);
else
- send_umode(NULL, source_p, 0, 0, ubuf);
+ send_umode(NULL, source_p, 0, ubuf);
if(!*ubuf)
{
s_assert(has_id(source_p));
- if(source_p->sockhost[0] == ':')
- {
- sockhost[0] = '0';
- sockhost[1] = '\0';
- rb_strlcat(sockhost, source_p->sockhost, sizeof(sockhost));
- } else
- strcpy(sockhost, source_p->sockhost);
-
if (use_euid)
sendto_server(client_p, NULL, CAP_EUID | CAP_TS6, NOCAPS,
":%s EUID %s %d %ld %s %s %s %s %s %s %s :%s",
source_p->hopcount + 1,
(long) source_p->tsinfo, ubuf,
source_p->username, source_p->host,
- IsIPSpoof(source_p) ? "0" : sockhost,
+ IsIPSpoof(source_p) ? "0" : source_p->sockhost,
source_p->id,
IsDynSpoof(source_p) ? source_p->orighost : "*",
EmptyString(source_p->user->suser) ? "*" : source_p->user->suser,
source_p->hopcount + 1,
(long) source_p->tsinfo, ubuf,
source_p->username, source_p->host,
- IsIPSpoof(source_p) ? "0" : sockhost,
+ IsIPSpoof(source_p) ? "0" : source_p->sockhost,
source_p->id, source_p->info);
if(!EmptyString(source_p->certfp))
if(hostname == NULL)
return NO;
+ if(!strcmp(hostname, "localhost"))
+ return YES;
+
if('.' == *p || ':' == *p || '/' == *p)
return NO;
* -avalon
*/
void
-send_umode(struct Client *client_p, struct Client *source_p, int old, int sendmask, char *umode_buf)
+send_umode(struct Client *client_p, struct Client *source_p, int old, char *umode_buf)
{
int i;
int flag;
char buf[BUFSIZE];
rb_dlink_node *ptr;
- send_umode(NULL, source_p, old, 0, buf);
+ send_umode(NULL, source_p, old, buf);
RB_DLINK_FOREACH(ptr, serv_list.head)
{
}
if(client_p && MyClient(client_p))
- send_umode(client_p, source_p, old, 0, buf);
+ send_umode(client_p, source_p, old, buf);
}
/*