Skip to content

Commit

Permalink
Fix hostmask cloaking bug, don't cloak multiple times
Browse files Browse the repository at this point in the history
Previously, each server would cloak every user's hostmask. The problem
is that if a network has more than one server, then a user's hostmask
would get cloaked twice. This patch ensures that a server only cloaks
the hostmask if it has not yet been cloaked (the period indicates it's
still an IP address).

Closes #228.
  • Loading branch information
JRMU authored and alexbarton committed Sep 9, 2019
1 parent e954b59 commit 147e424
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ngircd/client.c
Expand Up @@ -337,7 +337,9 @@ Client_SetHostname( CLIENT *Client, const char *Hostname )
assert(Client != NULL);
assert(Hostname != NULL);

if (Conf_CloakHost[0]) {
/* Only cloak the hostmask if it has not yet been cloaked (the period
* indicates it's still an IP address). */
if (Conf_CloakHost[0] && strchr(Client->host, '.')) {
char cloak[GETID_LEN];

strlcpy(cloak, Hostname, GETID_LEN);
Expand Down

0 comments on commit 147e424

Please sign in to comment.