summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar special2009-09-13 19:33:24 +0000
committerGravatar special2009-09-13 19:33:24 +0000
commit1f125df372cbb3f0b872b711f85db6801cd0c4af (patch)
tree8b5fa420760cfc97deefb20f8f7cb906b78f2a71
parentGnuTLS: Send SSL client certificate on server link (diff)
Don't allow /who to match servers when HideWhoisServer is enabled (unless the user has the privilege)
git-svn-id: http://svn.inspircd.org/repository/branches/1_2_stable@11694 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/commands/cmd_who.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp
index 718eb2002..b08e43c90 100644
--- a/src/commands/cmd_who.cpp
+++ b/src/commands/cmd_who.cpp
@@ -28,7 +28,7 @@ static const std::string& get_first_visible_channel(User *u)
return star;
}
-bool CommandWho::whomatch(User* user, const char* matchtext)
+bool CommandWho::whomatch(User* cuser, User* user, const char* matchtext)
{
bool match = false;
bool positive = false;
@@ -111,7 +111,8 @@ bool CommandWho::whomatch(User* user, const char* matchtext)
if (!match)
match = InspIRCd::Match(user->nick, matchtext);
- if (!match)
+ /* Don't allow server name matches if HideWhoisServer is enabled, unless the command user has the priv */
+ if (!match && (!*ServerInstance->Config->HideWhoisServer || cuser->HasPrivPermission("users/auspex")))
match = InspIRCd::Match(user->server, matchtext);
return match;
@@ -323,7 +324,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
{
User* oper = *i;
- if (whomatch(oper, matchtext))
+ if (whomatch(user, oper, matchtext))
{
if (!user->SharesChannelWith(oper))
{
@@ -339,7 +340,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
{
for (user_hash::iterator i = ServerInstance->Users->clientlist->begin(); i != ServerInstance->Users->clientlist->end(); i++)
{
- if (whomatch(i->second, matchtext))
+ if (whomatch(user, i->second, matchtext))
{
if (!user->SharesChannelWith(i->second))
{