/* * me_realhost * parv[1] = real host * * Yes this contains a little race condition if someone does a whois * in between the UID and REALHOST and use_whois_actually is enabled. * I don't think that's a big problem as the whole thing is a * race condition. */ static int me_realhost(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { if (!IsPerson(source_p)) return 0; del_from_hostname_hash(source_p->orighost, source_p); rb_strlcpy(source_p->orighost, parv[1], sizeof source_p->orighost); if (irccmp(source_p->host, source_p->orighost)) SetDynSpoof(source_p); else ClearDynSpoof(source_p); add_to_hostname_hash(source_p->orighost, source_p); return 0; }
struct Client *make_remote_person_full(struct Client *server, const char *nick, const char *username, const char *hostname, const char *ip, const char *realname) { struct Client *client; struct sockaddr addr; client = make_client(server); make_user(client); SetRemoteClient(client); client->servptr = server; rb_dlinkAdd(server, &server->lnode, &server->servptr->serv->users); rb_inet_pton_sock(ip, &addr); rb_strlcpy(client->name, nick, sizeof(client->name)); rb_strlcpy(client->username, username, sizeof(client->username)); rb_strlcpy(client->host, hostname, sizeof(client->host)); rb_inet_ntop_sock(&addr, client->sockhost, sizeof(client->sockhost)); rb_strlcpy(client->info, realname, sizeof(client->info)); add_to_client_hash(nick, client); add_to_hostname_hash(client->host, client); return client; }