From d21afce2b6fdc919a80c4eb1d6ba781c1cf63f3c Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 26 Sep 2012 22:52:06 +0200 Subject: Allow user mode +x only when "CloakHostModeX" is set Allow users to "cloak" their hostname only when the configuration variable "CloakHostModeX" (introduced in 19.2) is set. Otherwise, only IRC opertators, other servers, and services are allowed to set mode +x. This prevents regular users from changing their hostmask to the name of the IRC server itself, which confused quite a few people ;-) This fixes bug #133. --- src/ngircd/irc-mode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index 7380c6eb..90f638d8 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -278,9 +278,15 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) ok = IRC_WriteStrClient(Origin, ERR_RESTRICTED_MSG, Client_ID(Origin)); - else + else if (!set || Conf_CloakHostModeX[0] + || Client_Type(Client) == CLIENT_SERVER + || Client_OperByMe(Client)) { x[0] = 'x'; send_RPL_HOSTHIDDEN_MSG = true; + } else + ok = IRC_WriteStrClient(Origin, + ERR_NOPRIVILEGES_MSG, + Client_ID(Origin)); break; default: if (Client_Type(Client) != CLIENT_SERVER) { -- cgit 1.4.1