From: Michael Poole Date: Mon, 15 Feb 2010 20:56:42 +0000 (-0500) Subject: Properly check for fake idents when checking for user matches. X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=f7864d92f714c99533bd6e6023aabb6a8c404d75 Properly check for fake idents when checking for user matches. --- diff --git a/src/proto-common.c b/src/proto-common.c index c318a95..c04fd71 100644 --- a/src/proto-common.c +++ b/src/proto-common.c @@ -737,6 +737,8 @@ generate_hostmask(struct userNode *user, int options) ident = user->ident; else if (options & GENMASK_ANY_IDENT) ident = "*"; + else if (IsFakeIdent(user) && IsHiddenHost(user) && !(options & GENMASK_NO_HIDING)) + ident = user->fakeident; else { ident = alloca(strlen(user->ident)+2); ident[0] = '*'; diff --git a/src/proto-p10.c b/src/proto-p10.c index 4f7f290..ec517d1 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -945,7 +945,11 @@ static CMD_FUNC(cmd_whois) return 1; } - if (IsFakeHost(who) && IsHiddenHost(who)) + if (IsFakeHost(who) && IsFakeIdent(who) && IsHiddenHost(who)) + irc_numeric(from, RPL_WHOISUSER, "%s %s %s * :%s", who->nick, who->fakeident, who->fakehost, who->info); + else if (IsFakeIdent(who) && IsHiddenHost(who)) + irc_numeric(from, RPL_WHOISUSER, "%s %s %s * :%s", who->nick, who->fakeident, who->hostname, who->info); + else if (IsFakeHost(who) && IsHiddenHost(who)) irc_numeric(from, RPL_WHOISUSER, "%s %s %s * :%s", who->nick, who->ident, who->fakehost, who->info); else if (IsHiddenHost(who) && who->handle_info && hidden_host_suffix) irc_numeric(from, RPL_WHOISUSER, "%s %s %s.%s * :%s", who->nick, who->ident, who->handle_info->handle, hidden_host_suffix, who->info); diff --git a/src/tools.c b/src/tools.c index a6bb073..7ba3738 100644 --- a/src/tools.c +++ b/src/tools.c @@ -612,7 +612,8 @@ user_matches_glob(struct userNode *user, const char *orig_glob, int flags) return 0; } *marker = 0; - if (!match_ircglob(user->ident, glob)) + if (((IsFakeIdent(user) && IsHiddenHost(user) && (flags & MATCH_VISIBLE)) || !match_ircglob(user->ident, glob)) && + !(IsFakeIdent(user) && match_ircglob(user->fakeident, glob))) return 0; glob = marker + 1; /* Check for a fakehost match. */