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.
This commit is contained in:
Alexander Barton 2012-09-26 22:52:06 +02:00
parent 808c291c76
commit d21afce2b6
2 changed files with 15 additions and 1 deletions

View File

@ -12,6 +12,14 @@
I. Upgrade Information I. Upgrade Information
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
Differences to version 19.x
- Starting with ngIRCd 20, users can "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 ;-)
Differences to version 17 Differences to version 17
- Support for ZeroConf/Bonjour/Rendezvous service registration has been - Support for ZeroConf/Bonjour/Rendezvous service registration has been

View File

@ -278,9 +278,15 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
ok = IRC_WriteStrClient(Origin, ok = IRC_WriteStrClient(Origin,
ERR_RESTRICTED_MSG, ERR_RESTRICTED_MSG,
Client_ID(Origin)); Client_ID(Origin));
else else if (!set || Conf_CloakHostModeX[0]
|| Client_Type(Client) == CLIENT_SERVER
|| Client_OperByMe(Client)) {
x[0] = 'x'; x[0] = 'x';
send_RPL_HOSTHIDDEN_MSG = true; send_RPL_HOSTHIDDEN_MSG = true;
} else
ok = IRC_WriteStrClient(Origin,
ERR_NOPRIVILEGES_MSG,
Client_ID(Origin));
break; break;
default: default:
if (Client_Type(Client) != CLIENT_SERVER) { if (Client_Type(Client) != CLIENT_SERVER) {