From c88cdb00957d1bafae4587343b5ab7df14b75f8b Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 20 Nov 2007 06:36:55 -0600 Subject: [PATCH] Get rid of User.server. --- extensions/sno_whois.c | 2 +- extensions/spy_admin_notice.c | 2 +- extensions/spy_info_notice.c | 2 +- extensions/spy_links_notice.c | 2 +- extensions/spy_motd_notice.c | 2 +- extensions/spy_stats_notice.c | 6 ++--- extensions/spy_stats_p_notice.c | 2 +- extensions/spy_trace_notice.c | 4 ++-- include/client.h | 1 - modules/core/m_join.c | 2 +- modules/core/m_kill.c | 8 +++---- modules/core/m_message.c | 4 ++-- modules/core/m_nick.c | 15 +++++------- modules/m_etrace.c | 2 +- modules/m_gline.c | 42 ++++++++++++++++----------------- modules/m_kline.c | 4 ++-- modules/m_locops.c | 4 ++-- modules/m_rehash.c | 2 +- modules/m_resv.c | 4 ++-- modules/m_user.c | 1 - modules/m_who.c | 6 ++--- modules/m_whois.c | 4 ++-- modules/m_xline.c | 4 ++-- src/s_serv.c | 4 ++-- src/s_user.c | 4 ++-- src/whowas.c | 3 ++- 26 files changed, 66 insertions(+), 70 deletions(-) diff --git a/extensions/sno_whois.c b/extensions/sno_whois.c index d02c6f6a..cc819427 100644 --- a/extensions/sno_whois.c +++ b/extensions/sno_whois.c @@ -59,6 +59,6 @@ show_whois(hook_data_client *data) ":*** Notice -- %s (%s@%s) is doing a whois on you [%s]", source_p->name, source_p->username, source_p->host, - source_p->user->server); + source_p->servptr->name); } } diff --git a/extensions/spy_admin_notice.c b/extensions/spy_admin_notice.c index f8627fc9..4171e09f 100644 --- a/extensions/spy_admin_notice.c +++ b/extensions/spy_admin_notice.c @@ -43,5 +43,5 @@ show_admin(hook_data *data) sendto_realops_snomask(SNO_SPY, L_ALL, "admin requested by %s (%s@%s) [%s]", data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } diff --git a/extensions/spy_info_notice.c b/extensions/spy_info_notice.c index 30539402..a3df589a 100644 --- a/extensions/spy_info_notice.c +++ b/extensions/spy_info_notice.c @@ -43,5 +43,5 @@ show_info(hook_data *data) sendto_realops_snomask(SNO_SPY, L_ALL, "info requested by %s (%s@%s) [%s]", data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } diff --git a/extensions/spy_links_notice.c b/extensions/spy_links_notice.c index b71e2d40..efc39a6c 100644 --- a/extensions/spy_links_notice.c +++ b/extensions/spy_links_notice.c @@ -45,5 +45,5 @@ show_links(hook_data *data) sendto_realops_snomask(SNO_SPY, L_ALL, "LINKS '%s' requested by %s (%s@%s) [%s]", mask, data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } diff --git a/extensions/spy_motd_notice.c b/extensions/spy_motd_notice.c index b872f34b..3a40955f 100644 --- a/extensions/spy_motd_notice.c +++ b/extensions/spy_motd_notice.c @@ -43,5 +43,5 @@ show_motd(hook_data *data) sendto_realops_snomask(SNO_SPY, L_ALL, "motd requested by %s (%s@%s) [%s]", data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } diff --git a/extensions/spy_stats_notice.c b/extensions/spy_stats_notice.c index 8d575167..240050f2 100644 --- a/extensions/spy_stats_notice.c +++ b/extensions/spy_stats_notice.c @@ -52,19 +52,19 @@ show_stats(hook_data_int *data) statchar, data->client->name, data->client->username, data->client->host, - data->client->user->server, name); + data->client->servptr->name, name); else sendto_realops_snomask(SNO_SPY, L_ALL, "STATS %c requested by %s (%s@%s) [%s]", statchar, data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } else { sendto_realops_snomask(SNO_SPY, L_ALL, "STATS %c requested by %s (%s@%s) [%s]", statchar, data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } } diff --git a/extensions/spy_stats_p_notice.c b/extensions/spy_stats_p_notice.c index 72b08b67..0d0f3879 100644 --- a/extensions/spy_stats_p_notice.c +++ b/extensions/spy_stats_p_notice.c @@ -43,5 +43,5 @@ show_stats_p(hook_data *data) sendto_realops_snomask(SNO_SPY, L_ALL, "STATS p requested by %s (%s@%s) [%s]", data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } diff --git a/extensions/spy_trace_notice.c b/extensions/spy_trace_notice.c index 8c4560ab..31dfe608 100644 --- a/extensions/spy_trace_notice.c +++ b/extensions/spy_trace_notice.c @@ -44,11 +44,11 @@ show_trace(hook_data_client *data) sendto_realops_snomask(SNO_SPY, L_ALL, "trace requested by %s (%s@%s) [%s] on %s", data->client->name, data->client->username, - data->client->host, data->client->user->server, + data->client->host, data->client->servptr->name, data->target->name); else sendto_realops_snomask(SNO_SPY, L_ALL, "trace requested by %s (%s@%s) [%s]", data->client->name, data->client->username, - data->client->host, data->client->user->server); + data->client->host, data->client->servptr->name); } diff --git a/include/client.h b/include/client.h index a52f6869..a0e44eeb 100644 --- a/include/client.h +++ b/include/client.h @@ -95,7 +95,6 @@ struct User dlink_list invited; /* chain of invite pointer blocks */ char *away; /* pointer to away message */ int refcnt; /* Number of times this block is referenced */ - const char *server; /* pointer to scached server name */ char suser[NICKLEN+1]; }; diff --git a/modules/core/m_join.c b/modules/core/m_join.c index ea5372b0..e65b042f 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -511,7 +511,7 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char * source_p->id, (long) chptr->channelts, chptr->chname); sendto_server(client_p, chptr, NOCAPS, CAP_TS6, ":%s SJOIN %ld %s %s :%s", - source_p->user->server, (long) chptr->channelts, + source_p->servptr->name, (long) chptr->channelts, chptr->chname, keep_new_modes ? "+" : "0", source_p->name); return 0; diff --git a/modules/core/m_kill.c b/modules/core/m_kill.c index ca59821a..eaffc568 100644 --- a/modules/core/m_kill.c +++ b/modules/core/m_kill.c @@ -131,7 +131,7 @@ mo_kill(struct Client *client_p, struct Client *source_p, int parc, const char * ilog(L_KILL, "%c %s %s!%s@%s %s %s", MyConnect(target_p) ? 'L' : 'G', get_oper_name(source_p), - target_p->name, target_p->username, target_p->host, target_p->user->server, reason); + target_p->name, target_p->username, target_p->host, target_p->servptr->name, reason); /* ** And pass on the message to other servers. Note, that if KILL @@ -247,13 +247,13 @@ ms_kill(struct Client *client_p, struct Client *source_p, int parc, const char * sendto_realops_snomask(IsService(source_p) ? SNO_SKILL : SNO_GENERAL, L_ALL, "Received KILL message for %s!%s@%s. From %s Path: %s!%s!%s!%s %s", target_p->name, target_p->username, target_p->orighost, parv[0], - source_p->user->server, source_p->host, source_p->username, + source_p->servptr->name, source_p->host, source_p->username, source_p->name, reason); ilog(L_KILL, "%c %s %s!%s@%s %s %s", MyConnect(target_p) ? 'O' : 'R', get_oper_name(source_p), target_p->name, target_p->username, target_p->host, - target_p->user->server, reason); + target_p->servptr->name, reason); } else { @@ -264,7 +264,7 @@ ms_kill(struct Client *client_p, struct Client *source_p, int parc, const char * ilog(L_KILL, "S %s %s!%s@%s %s %s", source_p->name, target_p->name, target_p->username, - target_p->host, target_p->user->server, reason); + target_p->host, target_p->servptr->name, reason); } relay_kill(client_p, source_p, target_p, path, reason); diff --git a/modules/core/m_message.c b/modules/core/m_message.c index f05b914b..e6fe7ef4 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -785,7 +785,7 @@ flood_attack_client(int p_or_n, struct Client *source_p, struct Client *target_p "Possible Flooder %s[%s@%s] on %s target: %s", source_p->name, source_p->username, source_p->orighost, - source_p->user->server, target_p->name); + source_p->servptr->name, target_p->name); target_p->localClient->flood_noticed = 1; /* add a bit of penalty */ target_p->localClient->received_number_of_privmsgs += 2; @@ -840,7 +840,7 @@ flood_attack_channel(int p_or_n, struct Client *source_p, struct Channel *chptr, "Possible Flooder %s[%s@%s] on %s target: %s", source_p->name, source_p->username, source_p->orighost, - source_p->user->server, chptr->chname); + source_p->servptr->name, chptr->chname); chptr->flood_noticed = 1; /* Add a bit of penalty */ diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c index 3a584022..6fb0dba0 100644 --- a/modules/core/m_nick.c +++ b/modules/core/m_nick.c @@ -284,7 +284,7 @@ mc_nick(struct Client *client_p, struct Client *source_p, int parc, const char * ServerStats->is_kill++; sendto_realops_snomask(SNO_DEBUG, L_ALL, "Bad Nick: %s From: %s(via %s)", - parv[1], source_p->user->server, client_p->name); + parv[1], source_p->servptr->name, client_p->name); sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)", me.name, parv[1], me.name); /* bad nick change, issue kill for the old nick to the rest @@ -1186,7 +1186,6 @@ register_client(struct Client *client_p, struct Client *server, if(parc == 12) { - user->server = find_or_add(server->name); strlcpy(source_p->info, parv[11], sizeof(source_p->info)); strlcpy(source_p->sockhost, parv[7], sizeof(source_p->sockhost)); strlcpy(source_p->id, parv[8], sizeof(source_p->id)); @@ -1202,7 +1201,6 @@ register_client(struct Client *client_p, struct Client *server, } else if(parc == 10) { - user->server = find_or_add(server->name); strlcpy(source_p->info, parv[9], sizeof(source_p->info)); strlcpy(source_p->sockhost, parv[7], sizeof(source_p->sockhost)); strlcpy(source_p->id, parv[8], sizeof(source_p->id)); @@ -1210,7 +1208,6 @@ register_client(struct Client *client_p, struct Client *server, } else { - user->server = find_or_add(parv[7]); strlcpy(source_p->info, parv[8], sizeof(source_p->info)); } @@ -1234,7 +1231,7 @@ register_client(struct Client *client_p, struct Client *server, DLINK_FOREACH(ptr, service_list.head) { - if(!irccmp((const char *) ptr->data, user->server)) + if(!irccmp((const char *) ptr->data, server->name)) { hit++; break; @@ -1270,11 +1267,11 @@ register_client(struct Client *client_p, struct Client *server, if(server == NULL) { - if((source_p->servptr = find_server(NULL, user->server)) == NULL) + if((source_p->servptr = find_server(NULL, server->name)) == NULL) { sendto_realops_snomask(SNO_GENERAL, L_ALL, "Ghost killed: %s on invalid server %s", - source_p->name, user->server); + source_p->name, server->name); kill_client(client_p, source_p, "%s (Server doesn't exist)", me.name); source_p->flags |= FLAGS_KILLED; return exit_client(NULL, source_p, &me, "Ghosted Client"); @@ -1294,10 +1291,10 @@ register_client(struct Client *client_p, struct Client *server, "Bad User [%s] :%s USER %s@%s %s, != %s[%s]", client_p->name, source_p->name, source_p->username, source_p->host, - user->server, target_p->name, target_p->from->name); + server->name, target_p->name, target_p->from->name); kill_client(client_p, source_p, "%s (NICK from wrong direction (%s != %s))", - me.name, user->server, target_p->from->name); + me.name, server->name, target_p->from->name); source_p->flags |= FLAGS_KILLED; return exit_client(source_p, source_p, &me, "USER server wrong direction"); } diff --git a/modules/m_etrace.c b/modules/m_etrace.c index d456845b..ac456251 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -107,7 +107,7 @@ mo_etrace(struct Client *client_p, struct Client *source_p, int parc, const char if(!MyClient(target_p)) sendto_one(target_p, ":%s ENCAP %s ETRACE %s", get_id(source_p, target_p), - target_p->user->server, + target_p->servptr->name, get_id(target_p, target_p)); else do_single_etrace(source_p, target_p); diff --git a/modules/m_gline.c b/modules/m_gline.c index ad156283..92d87d2e 100644 --- a/modules/m_gline.c +++ b/modules/m_gline.c @@ -178,7 +178,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, int parc, const char source_p->host, me.name, user, host, reason); ilog(L_GLINE, "R %s %s %s %s %s %s %s", source_p->name, source_p->username, source_p->host, - source_p->user->server, user, host, reason); + source_p->servptr->name, user, host, reason); /* If at least 3 opers agree this user should be G lined then do it */ majority_gline(source_p, user, host, reason); @@ -195,7 +195,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, int parc, const char sendto_server(NULL, NULL, NOCAPS, CAP_GLN, ":%s GLINE %s %s %s %s %s %s :%s", me.name, source_p->name, source_p->username, - source_p->host, source_p->user->server, + source_p->host, source_p->servptr->name, user, host, reason); return 0; } @@ -233,9 +233,9 @@ mc_gline(struct Client *client_p, struct Client *source_p, acptr->name, user, host, reason); sendto_server(client_p, NULL, NOCAPS, CAP_GLN, ":%s GLINE %s %s %s %s %s %s :%s", - acptr->user->server, acptr->name, + acptr->servptr->name, acptr->name, acptr->username, acptr->host, - acptr->user->server, user, host, reason); + acptr->servptr->name, user, host, reason); if(!ConfigFileEntry.glines) return 0; @@ -247,7 +247,7 @@ mc_gline(struct Client *client_p, struct Client *source_p, "%s!%s@%s on %s is requesting a gline without " "%d non-wildcard characters for [%s@%s] [%s]", acptr->name, acptr->username, - acptr->host, acptr->user->server, + acptr->host, acptr->servptr->name, ConfigFileEntry.min_nonwildcard, user, host, reason); return 0; @@ -266,7 +266,7 @@ mc_gline(struct Client *client_p, struct Client *source_p, sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s on %s is requesting a " "gline with a cidr mask < %d for [%s@%s] [%s]", acptr->name, acptr->username, acptr->host, - acptr->user->server, + acptr->servptr->name, ConfigFileEntry.gline_min_cidr, user, host, reason); return 0; @@ -278,7 +278,7 @@ mc_gline(struct Client *client_p, struct Client *source_p, sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s on %s is requesting a " "gline with a cidr mask < %d for [%s@%s] [%s]", acptr->name, acptr->username, acptr->host, - acptr->user->server, + acptr->servptr->name, ConfigFileEntry.gline_min_cidr6, user, host, reason); return 0; @@ -289,11 +289,11 @@ mc_gline(struct Client *client_p, struct Client *source_p, sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s on %s is requesting gline for [%s@%s] [%s]", acptr->name, acptr->username, acptr->host, - acptr->user->server, user, host, reason); + acptr->servptr->name, user, host, reason); ilog(L_GLINE, "R %s %s %s %s %s %s %s", source_p->name, source_p->username, source_p->host, - source_p->user->server, user, host, reason); + source_p->servptr->name, user, host, reason); /* If at least 3 opers agree this user should be G lined then do it */ majority_gline(acptr, user, host, reason); @@ -345,9 +345,9 @@ ms_gline(struct Client *client_p, struct Client *source_p, int parc, const char acptr->name, user, host, reason); sendto_server(client_p, NULL, NOCAPS, CAP_GLN, ":%s GLINE %s %s %s %s %s %s :%s", - acptr->user->server, acptr->name, + acptr->servptr->name, acptr->name, acptr->username, acptr->host, - acptr->user->server, user, host, reason); + acptr->servptr->name, user, host, reason); if(!ConfigFileEntry.glines) return 0; @@ -359,7 +359,7 @@ ms_gline(struct Client *client_p, struct Client *source_p, int parc, const char "%s!%s@%s on %s is requesting a gline without " "%d non-wildcard characters for [%s@%s] [%s]", acptr->name, acptr->username, - acptr->host, acptr->user->server, + acptr->host, acptr->servptr->name, ConfigFileEntry.min_nonwildcard, user, host, reason); return 0; @@ -368,11 +368,11 @@ ms_gline(struct Client *client_p, struct Client *source_p, int parc, const char sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s on %s is requesting gline for [%s@%s] [%s]", acptr->name, acptr->username, acptr->host, - acptr->user->server, user, host, reason); + acptr->servptr->name, user, host, reason); ilog(L_GLINE, "R %s %s %s %s %s %s %s", acptr->name, acptr->username, acptr->host, - acptr->user->server, user, host, reason); + acptr->servptr->name, user, host, reason); /* If at least 3 opers agree this user should be G lined then do it */ majority_gline(acptr, user, host, reason); @@ -443,7 +443,7 @@ mo_ungline(struct Client *client_p, struct Client *source_p, int parc, const cha get_oper_name(source_p), user, host); ilog(L_GLINE, "U %s %s %s %s %s %s", source_p->name, source_p->username, source_p->host, - source_p->user->server, user, host); + source_p->servptr->name, user, host); } else { @@ -569,11 +569,11 @@ set_local_gline(struct Client *source_p, const char *user, sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s on %s has triggered gline for [%s@%s] [%s]", source_p->name, source_p->username, - source_p->host, source_p->user->server, + source_p->host, source_p->servptr->name, user, host, reason); ilog(L_GLINE, "T %s %s %s %s %s %s %s", source_p->name, source_p->username, source_p->host, - source_p->user->server, user, host, reason); + source_p->servptr->name, user, host, reason); check_glines(); } @@ -612,7 +612,7 @@ majority_gline(struct Client *source_p, const char *user, sendto_realops_snomask(SNO_GENERAL, L_ALL, "oper has already voted"); return NO; } - else if(irccmp(pending->oper_server1, source_p->user->server) == 0) + else if(irccmp(pending->oper_server1, source_p->servptr->name) == 0) { sendto_realops_snomask(SNO_GENERAL, L_ALL, "server has already voted"); return NO; @@ -628,7 +628,7 @@ majority_gline(struct Client *source_p, const char *user, "oper has already voted"); return NO; } - else if(irccmp(pending->oper_server2, source_p->user->server) == 0) + else if(irccmp(pending->oper_server2, source_p->servptr->name) == 0) { sendto_realops_snomask(SNO_GENERAL, L_ALL, "server has already voted"); @@ -651,7 +651,7 @@ majority_gline(struct Client *source_p, const char *user, strlcpy(pending->oper_host2, source_p->host, sizeof(pending->oper_host2)); DupString(pending->reason2, reason); - pending->oper_server2 = find_or_add(source_p->user->server); + pending->oper_server2 = find_or_add(source_p->servptr->name); pending->last_gline_time = CurrentTime; pending->time_request2 = CurrentTime; return NO; @@ -670,7 +670,7 @@ majority_gline(struct Client *source_p, const char *user, strlcpy(pending->oper_host1, source_p->host, sizeof(pending->oper_host1)); - pending->oper_server1 = find_or_add(source_p->user->server); + pending->oper_server1 = find_or_add(source_p->servptr->name); strlcpy(pending->user, user, sizeof(pending->user)); strlcpy(pending->host, host, sizeof(pending->host)); diff --git a/modules/m_kline.c b/modules/m_kline.c index 0b31f409..ff1eaedd 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -280,7 +280,7 @@ handle_remote_kline(struct Client *source_p, int tkline_time, char *oper_reason; if(!find_shared_conf(source_p->username, source_p->host, - source_p->user->server, + source_p->servptr->name, (tkline_time > 0) ? SHARED_TKLINE : SHARED_PKLINE)) return; @@ -466,7 +466,7 @@ static void handle_remote_unkline(struct Client *source_p, const char *user, const char *host) { if(!find_shared_conf(source_p->username, source_p->host, - source_p->user->server, SHARED_UNKLINE)) + source_p->servptr->name, SHARED_UNKLINE)) return; if(remove_temp_kline(user, host)) diff --git a/modules/m_locops.c b/modules/m_locops.c index bd2a175a..fb07053c 100644 --- a/modules/m_locops.c +++ b/modules/m_locops.c @@ -81,7 +81,7 @@ ms_locops(struct Client *client_p, struct Client *source_p, int parc, const char if(!match(parv[1], me.name)) return 0; - if(find_shared_conf("*", "*", source_p->user->server, SHARED_LOCOPS)) + if(find_shared_conf("*", "*", source_p->servptr->name, SHARED_LOCOPS)) sendto_wallops_flags(UMODE_LOCOPS, source_p, "SLOCOPS - %s", parv[2]); return 0; @@ -94,7 +94,7 @@ me_locops(struct Client *client_p, struct Client *source_p, if(!IsPerson(source_p)) return 0; - if(find_shared_conf("*", "*", source_p->user->server, SHARED_LOCOPS)) + if(find_shared_conf("*", "*", source_p->servptr->name, SHARED_LOCOPS)) sendto_wallops_flags(UMODE_LOCOPS, source_p, "SLOCOPS - %s", parv[1]); return 0; diff --git a/modules/m_rehash.c b/modules/m_rehash.c index e979a587..e4e66aba 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -402,7 +402,7 @@ me_rehash(struct Client *client_p, struct Client *source_p, int parc, const char return 0; if (!find_shared_conf(source_p->username, source_p->host, - source_p->user->server, SHARED_REHASH)) + source_p->servptr->name, SHARED_REHASH)) return 0; do_rehash(source_p, parc > 1 ? parv[1] : NULL); diff --git a/modules/m_resv.c b/modules/m_resv.c index b2e28027..515d3166 100644 --- a/modules/m_resv.c +++ b/modules/m_resv.c @@ -186,7 +186,7 @@ parse_resv(struct Client *source_p, const char *name, if(!MyClient(source_p) && !find_shared_conf(source_p->username, source_p->host, - source_p->user->server, + source_p->servptr->name, (temp_time > 0) ? SHARED_TRESV : SHARED_PRESV)) return; @@ -435,7 +435,7 @@ static void handle_remote_unresv(struct Client *source_p, const char *name) { if(!find_shared_conf(source_p->username, source_p->host, - source_p->user->server, SHARED_UNRESV)) + source_p->servptr->name, SHARED_UNRESV)) return; if(remove_temp_resv(source_p, name)) diff --git a/modules/m_user.c b/modules/m_user.c index a36e3206..df6c359a 100644 --- a/modules/m_user.c +++ b/modules/m_user.c @@ -90,7 +90,6 @@ do_local_user(struct Client *client_p, struct Client *source_p, s_assert(source_p->username != username); user = make_user(source_p); - user->server = me.name; if (!(source_p->flags & FLAGS_SENTUSER)) { diff --git a/modules/m_who.c b/modules/m_who.c index e83ff4ce..8ef2624f 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -244,7 +244,7 @@ who_common_channel(struct Client *source_p, struct Channel *chptr, { if((mask == NULL) || match(mask, target_p->name) || match(mask, target_p->username) || - match(mask, target_p->host) || match(mask, target_p->user->server) || + match(mask, target_p->host) || match(mask, target_p->servptr->name) || (IsOper(source_p) && match(mask, target_p->orighost)) || match(mask, target_p->info)) { @@ -313,7 +313,7 @@ who_global(struct Client *source_p, const char *mask, int server_oper, int opers { if(!mask || match(mask, target_p->name) || match(mask, target_p->username) || - match(mask, target_p->host) || match(mask, target_p->user->server) || + match(mask, target_p->host) || match(mask, target_p->servptr->name) || (IsOper(source_p) && match(mask, target_p->orighost)) || match(mask, target_p->info)) { @@ -385,7 +385,7 @@ do_who(struct Client *source_p, struct Client *target_p, const char *chname, con sendto_one(source_p, form_str(RPL_WHOREPLY), me.name, source_p->name, (chname) ? (chname) : "*", target_p->username, - target_p->host, target_p->user->server, target_p->name, + target_p->host, target_p->servptr->name, target_p->name, status, ConfigServerHide.flatten_links ? 0 : target_p->hopcount, target_p->info); diff --git a/modules/m_whois.c b/modules/m_whois.c index 0b6dd326..14781190 100644 --- a/modules/m_whois.c +++ b/modules/m_whois.c @@ -201,7 +201,7 @@ do_whois(struct Client *client_p, struct Client *source_p, int parc, const char snprintf(buffer, sizeof(buffer), "%s!%s@%s %s", target_p->name, target_p->username, - target_p->host, target_p->user->server); + target_p->host, target_p->servptr->name); report_operspy(source_p, "WHOIS", buffer); } @@ -312,7 +312,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy) sendto_one(source_p, "%s", buf); sendto_one_numeric(source_p, RPL_WHOISSERVER, form_str(RPL_WHOISSERVER), - target_p->name, target_p->user->server, + target_p->name, target_p->servptr->name, a2client_p ? a2client_p->info : "*Not On This Net*"); if(target_p->user->away) diff --git a/modules/m_xline.c b/modules/m_xline.c index a11e9c32..7056137b 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -212,7 +212,7 @@ handle_remote_xline(struct Client *source_p, int temp_time, struct ConfItem *aconf; if(!find_shared_conf(source_p->username, source_p->host, - source_p->user->server, + source_p->servptr->name, (temp_time > 0) ? SHARED_TXLINE : SHARED_PXLINE)) return; @@ -524,7 +524,7 @@ static void handle_remote_unxline(struct Client *source_p, const char *name) { if(!find_shared_conf(source_p->username, source_p->host, - source_p->user->server, SHARED_UNXLINE)) + source_p->servptr->name, SHARED_UNXLINE)) return; if(remove_temp_xline(source_p, name)) diff --git a/src/s_serv.c b/src/s_serv.c index d33afa24..1c62d649 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -695,7 +695,7 @@ burst_TS5(struct Client *client_p) target_p->name, target_p->hopcount + 1, (long) target_p->tsinfo, ubuf, target_p->username, target_p->host, - target_p->user->server, target_p->info); + target_p->servptr->name, target_p->info); if(IsDynSpoof(target_p)) sendto_one(client_p, ":%s ENCAP * REALHOST %s", @@ -849,7 +849,7 @@ burst_TS6(struct Client *client_p) (long) target_p->tsinfo, ubuf, target_p->username, target_p->host, - target_p->user->server, target_p->info); + target_p->servptr->name, target_p->info); if(!has_id(target_p) || !IsCapable(client_p, CAP_EUID)) { diff --git a/src/s_user.c b/src/s_user.c index 07941dcd..ef413d51 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -637,7 +637,7 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User * nick, source_p->hopcount + 1, (long) source_p->tsinfo, ubuf, source_p->username, source_p->host, - user->server, source_p->info); + source_p->servptr->name, source_p->info); } else sendto_server(client_p, NULL, NOCAPS, NOCAPS, @@ -645,7 +645,7 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User * nick, source_p->hopcount + 1, (long) source_p->tsinfo, ubuf, source_p->username, source_p->host, - user->server, source_p->info); + source_p->servptr->name, source_p->info); if (IsDynSpoof(source_p)) { diff --git a/src/whowas.c b/src/whowas.c index 01279f72..d72cea15 100644 --- a/src/whowas.c +++ b/src/whowas.c @@ -39,6 +39,7 @@ #include "send.h" #include "s_conf.h" #include "memory.h" +#include "scache.h" /* internally defined function */ static void add_whowas_to_clist(struct Whowas **, struct Whowas *); @@ -86,7 +87,7 @@ void add_history(struct Client *client_p, int online) else who->sockhost[0] = '\0'; - who->servername = client_p->user->server; + who->servername = find_or_add(client_p->servptr->name); if(online) {