X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-info.c;h=57d6e1a2e327afbe5261d180bda6caac727d4e9a;hb=4a2d74c9abb6dbf5c64062c984c6f9e87a2c17ae;hp=89defc3829ffaf4bba4e05cbcb25377e87ec7a22;hpb=c9d166747d4ea161c55c765edc23e2cd3bd7dec4;p=ngircd.git diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 89defc38..57d6e1a2 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -727,7 +727,7 @@ IRC_USERHOST(CLIENT *Client, REQUEST *Req) strlcat(rpl, "+", sizeof(rpl)); strlcat(rpl, Client_User(c), sizeof(rpl)); strlcat(rpl, "@", sizeof(rpl)); - strlcat(rpl, Client_HostnameCloaked(c), sizeof(rpl)); + strlcat(rpl, Client_HostnameDisplayed(c), sizeof(rpl)); strlcat(rpl, " ", sizeof(rpl)); } } @@ -792,7 +792,7 @@ write_whoreply(CLIENT *Client, CLIENT *c, const char *channelname, const char *f { return IRC_WriteStrClient(Client, RPL_WHOREPLY_MSG, Client_ID(Client), channelname, Client_User(c), - Client_HostnameCloaked(c), + Client_HostnameDisplayed(c), Client_ID(Client_Introducer(c)), Client_ID(c), flags, Client_Hops(c), Client_Info(c)); } @@ -987,7 +987,7 @@ IRC_WHO_Mask(CLIENT *Client, char *Mask, bool OnlyOps) if (IRC_CheckListTooBig(Client, count, MAX_RPL_WHO, "WHO")) break; - strcpy(flags, who_flags_status(Client_Modes(c))); + strlcpy(flags, who_flags_status(Client_Modes(c)), sizeof(flags)); if (strchr(Client_Modes(c), 'o')) strlcat(flags, "*", sizeof(flags)); @@ -1080,7 +1080,7 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c) /* Nick, user, hostname and client info */ if (!IRC_WriteStrClient(from, RPL_WHOISUSER_MSG, Client_ID(from), Client_ID(c), Client_User(c), - Client_HostnameCloaked(c), Client_Info(c))) + Client_HostnameDisplayed(c), Client_Info(c))) return DISCONNECTED; /* Server */ @@ -1150,23 +1150,25 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c) Client_ID(c))) return DISCONNECTED; - /* Registered nick name? */ + /* Registered nickname? */ if (Client_HasMode(c, 'R') && !IRC_WriteStrClient(from, RPL_WHOISREGNICK_MSG, Client_ID(from), Client_ID(c))) return DISCONNECTED; + /* Local client and requester is the user itself or an IRC Op? */ if (Client_Conn(c) > NONE && - (from == c || (!Conf_MorePrivacy && Client_HasMode(from, 'o'))) && - !IRC_WriteStrClient(from, RPL_WHOISMODES_MSG, Client_ID(from), - Client_ID(c), Client_Modes(c))) - return DISCONNECTED; - - if (Client_Conn(c) > NONE && (Client_OperByMe(from) || from == c) && - !IRC_WriteStrClient(from, RPL_WHOISHOST_MSG, Client_ID(from), - Client_ID(c), Client_Hostname(c), - Conn_GetIPAInfo(Client_Conn(c)))) - return DISCONNECTED; + (from == c || (!Conf_MorePrivacy && Client_HasMode(from, 'o')))) { + /* Client hostname */ + if (!IRC_WriteStrClient(from, RPL_WHOISHOST_MSG, + Client_ID(from), Client_ID(c), Client_Hostname(c), + Conn_GetIPAInfo(Client_Conn(c)))) + return DISCONNECTED; + /* Client modes */ + if (!IRC_WriteStrClient(from, RPL_WHOISMODES_MSG, + Client_ID(from), Client_ID(c), Client_Modes(c))) + return DISCONNECTED; + } /* Idle and signon time (local clients only!) */ if (!Conf_MorePrivacy && Client_Conn(c) > NONE && @@ -1226,7 +1228,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req ) /* Get target server for this command */ if (Req->argc > 1) { /* Search the target server, which can be specified as a - * nick name on that server as well: */ + * nickname on that server as well: */ target = Client_Search(Req->argv[0]); if (!target) return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG,