X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-info.c;h=f9c9b0d2423c97b2ed8e2bf596a5f56fa1efa3ca;hb=1e8b775a7a6d0c390e037bd73332072e7c510525;hp=31a57c6fe5b1f46fb97c292449f3d50bbd6eb0e1;hpb=161adbb1aa6235acda9677ab14edd19581d9fcf4;p=ngircd.git diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 31a57c6f..f9c9b0d2 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)); } @@ -893,7 +893,8 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps) is_visible = strchr(client_modes, 'i') == NULL; if (is_member || is_visible) { - strcpy(flags, who_flags_status(client_modes)); + strlcpy(flags, who_flags_status(client_modes), + sizeof(flags)); if (is_ircop) strlcat(flags, "*", sizeof(flags)); @@ -950,7 +951,7 @@ IRC_WHO_Mask(CLIENT *Client, char *Mask, bool OnlyOps) if (Mask) { /* Match pattern against user host/server/name/nick */ client_match = MatchCaseInsensitive(Mask, - Client_Hostname(c)); + Client_HostnameDisplayed(c)); if (!client_match) client_match = MatchCaseInsensitive(Mask, Client_ID(Client_Introducer(c))); @@ -987,7 +988,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 +1081,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 */ @@ -1132,14 +1133,20 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c) return DISCONNECTED; } + /* Service? */ + if (Client_Type(c) == CLIENT_SERVICE && + !IRC_WriteStrClient(from, RPL_WHOISSERVICE_MSG, + Client_ID(from), Client_ID(c))) + return DISCONNECTED; + /* IRC-Operator? */ - if (Client_HasMode(c, 'o') && + if (Client_HasMode(c, 'o') && Client_Type(c) != CLIENT_SERVICE && !IRC_WriteStrClient(from, RPL_WHOISOPERATOR_MSG, Client_ID(from), Client_ID(c))) return DISCONNECTED; /* IRC-Bot? */ - if (Client_HasMode(c, 'B') && + if (Client_HasMode(c, 'B') && Client_Type(c) != CLIENT_SERVICE && !IRC_WriteStrClient(from, RPL_WHOISBOT_MSG, Client_ID(from), Client_ID(c))) return DISCONNECTED; @@ -1150,7 +1157,7 @@ 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))) @@ -1228,7 +1235,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, @@ -1261,7 +1268,8 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req ) */ if (!has_wildcards || is_remote) { c = Client_Search(query); - if (c && Client_Type(c) == CLIENT_USER) { + if (c && (Client_Type(c) == CLIENT_USER + || Client_Type(c) == CLIENT_SERVICE)) { if (!IRC_WHOIS_SendReply(Client, from, c)) return DISCONNECTED; } else {