Properly check for fake idents when checking for user matches.
authorMichael Poole <mdpoole@troilus.org>
Mon, 15 Feb 2010 20:56:42 +0000 (15:56 -0500)
committerMichael Poole <mdpoole@troilus.org>
Mon, 15 Feb 2010 20:56:42 +0000 (15:56 -0500)
src/proto-common.c
src/proto-p10.c
src/tools.c

index c318a95f05f6763f1a3a2b8a54cf9722a5d83110..c04fd712962e28e21faff9570f2e5418b51c4a44 100644 (file)
@@ -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] = '*';
index 4f7f29025a36fa53081b073253d37f477014e8d3..ec517d142dae628744a441e2b373731ca9e5fca5 100644 (file)
@@ -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);
index a6bb07350926624813bea51db21a84ec6f78cf1d..7ba3738e27c85b37f9858d92581250428b90e5ab 100644 (file)
@@ -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. */