diff options
author | Peter Powell <petpow@saberuk.com> | 2017-12-15 23:26:15 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-12-22 01:11:14 +0000 |
commit | e467fd0a6fc9ba97b2e2f31e654803a86bbb307f (patch) | |
tree | 5bd77f62832b7baac95223d9f320eb53e6c4b4bf | |
parent | 35a37bf46f2d2af8b346671de5d80d1073e5edb6 (diff) |
Rename <security:hidewhois> to <security:hideserver>.
The previous name was horrible and didn't describe what the setting
actually does.
-rw-r--r-- | docs/conf/inspircd.conf.example | 14 | ||||
-rw-r--r-- | include/configreader.h | 5 | ||||
-rw-r--r-- | src/configreader.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_who.cpp | 12 | ||||
-rw-r--r-- | src/coremods/core_whois.cpp | 10 | ||||
-rw-r--r-- | src/coremods/core_whowas.cpp | 4 | ||||
-rw-r--r-- | src/users.cpp | 8 |
7 files changed, 27 insertions, 28 deletions
diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index 945041624..980409863 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -688,13 +688,13 @@ # be flattened when shown to non-opers. flatlinks="no" - # hidewhois: When defined, the given text will be used in place - # of the server a user is on when whoised by a non-oper. Most - # networks will want to set this to something like "*.netname.net" - # to conceal the actual server a user is on. - # Note that enabling this will cause users' idle times to only be - # shown when the format /WHOIS <nick> <nick> is used. - hidewhois="" + # hideserver: When defined, the given text will be used in place + # of the server name in public messages. As with <server:name> this + # does not need to resolve but does need to be a valid hostname. + # + # NOTE: enabling this will cause users' idle times to only be shown + # when a remote whois (/WHOIS <nick> <nick>) is used. + #hideserver="*.example.com" # hidebans: If this value is set to yes, when a user is banned ([gkz]lined) # only opers will see the ban message when the user is removed diff --git a/include/configreader.h b/include/configreader.h index db7258d4e..1a2335e52 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -385,9 +385,8 @@ class CoreExport ServerConfig /** True if raw I/O is being logged */ bool RawLog; - /** Set to a non-empty string to obfuscate the server name of users in WHOIS - */ - std::string HideWhoisServer; + /** Set to a non-empty string to obfuscate server names. */ + std::string HideServer; /** Set to a non empty string to obfuscate nicknames prepended to a KILL. */ diff --git a/src/configreader.cpp b/src/configreader.cpp index ff9d5bd14..970aaba80 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -431,7 +431,7 @@ void ServerConfig::Fill() CustomVersion = security->getString("customversion"); HideSplits = security->getBool("hidesplits"); HideBans = security->getBool("hidebans"); - HideWhoisServer = security->getString("hidewhois"); + HideServer = security->getString("hideserver", security->getString("hidewhois")); HideKillsServer = security->getString("hidekills"); HideULineKills = security->getBool("hideulinekills"); RestrictBannedUsers = security->getBool("restrictbannedusers", true); diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp index 5a3db9f83..29feefc2b 100644 --- a/src/coremods/core_who.cpp +++ b/src/coremods/core_who.cpp @@ -166,8 +166,8 @@ bool CommandWho::whomatch(User* cuser, User* user, const char* matchtext) if (!match) match = InspIRCd::Match(user->nick, matchtext); - /* Don't allow server name matches if HideWhoisServer is enabled, unless the command user has the priv */ - if (!match && (ServerInstance->Config->HideWhoisServer.empty() || cuser->HasPrivPermission("users/auspex"))) + /* Don't allow server name matches if HideServer is enabled, unless the command user has the priv */ + if (!match && (ServerInstance->Config->HideServer.empty() || cuser->HasPrivPermission("users/auspex"))) match = InspIRCd::Match(user->server->GetName(), matchtext); return match; @@ -199,8 +199,8 @@ void CommandWho::SendWhoLine(User* user, const std::vector<std::string>& parms, Numeric::Numeric wholine(RPL_WHOREPLY); wholine.push(memb ? memb->chan->name : "*").push(u->ident); wholine.push(u->GetHost(opt_showrealhost)); - if (!ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex")) - wholine.push(ServerInstance->Config->HideWhoisServer); + if (!ServerInstance->Config->HideServer.empty() && !user->HasPrivPermission("servers/auspex")) + wholine.push(ServerInstance->Config->HideServer); else wholine.push(u->server->GetName()); @@ -305,11 +305,11 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User * opt_away = true; break; case 'l': - if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideWhoisServer.empty()) + if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideServer.empty()) opt_local = true; break; case 'f': - if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideWhoisServer.empty()) + if (user->HasPrivPermission("users/auspex") || ServerInstance->Config->HideServer.empty()) opt_far = true; break; case 't': diff --git a/src/coremods/core_whois.cpp b/src/coremods/core_whois.cpp index 19f5a862b..b5191dabd 100644 --- a/src/coremods/core_whois.cpp +++ b/src/coremods/core_whois.cpp @@ -201,9 +201,9 @@ void CommandWhois::DoWhois(LocalUser* user, User* dest, time_t signon, unsigned SendChanList(whois); - if (!whois.IsSelfWhois() && !ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex")) + if (!whois.IsSelfWhois() && !ServerInstance->Config->HideServer.empty() && !user->HasPrivPermission("servers/auspex")) { - whois.SendLine(RPL_WHOISSERVER, ServerInstance->Config->HideWhoisServer, ServerInstance->Config->Network); + whois.SendLine(RPL_WHOISSERVER, ServerInstance->Config->HideServer, ServerInstance->Config->Network); } else { @@ -238,7 +238,7 @@ void CommandWhois::DoWhois(LocalUser* user, User* dest, time_t signon, unsigned FOREACH_MOD_CUSTOM(evprov, Whois::EventListener, OnWhois, (whois)); /* - * We only send these if we've been provided them. That is, if hidewhois is turned off, and user is local, or + * We only send these if we've been provided them. That is, if hideserver is turned off, and user is local, or * if remote whois is queried, too. This is to keep the user hidden, and also since you can't reliably tell remote time. -- w00t */ if ((idle) || (signon)) @@ -292,14 +292,14 @@ CmdResult CommandWhois::HandleLocal(const std::vector<std::string>& parameters, { /* * Okay. Umpteenth attempt at doing this, so let's re-comment... - * For local users (/w localuser), we show idletime if hidewhois is disabled + * For local users (/w localuser), we show idletime if hideserver is disabled * For local users (/w localuser localuser), we always show idletime, hence parameters.size() > 1 check. * For remote users (/w remoteuser), we do NOT show idletime * For remote users (/w remoteuser remoteuser), spanningtree will handle calling do_whois, so we can ignore this case. * Thanks to djGrrr for not being impatient while I have a crap day coding. :p -- w00t */ LocalUser* localuser = IS_LOCAL(dest); - if (localuser && (ServerInstance->Config->HideWhoisServer.empty() || parameters.size() > 1)) + if (localuser && (ServerInstance->Config->HideServer.empty() || parameters.size() > 1)) { idle = labs((long)((localuser->idle_lastmsg)-ServerInstance->Time())); signon = dest->signon; diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp index 1f72fe2d2..f456a57db 100644 --- a/src/coremods/core_whowas.cpp +++ b/src/coremods/core_whowas.cpp @@ -67,8 +67,8 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use user->WriteNumeric(RPL_WHOWASIP, parameters[0], InspIRCd::Format("was connecting from *@%s", u->host.c_str())); std::string signon = InspIRCd::TimeString(u->signon); - bool hide_server = (!ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex")); - user->WriteNumeric(RPL_WHOISSERVER, parameters[0], (hide_server ? ServerInstance->Config->HideWhoisServer : u->server), signon); + bool hide_server = (!ServerInstance->Config->HideServer.empty() && !user->HasPrivPermission("servers/auspex")); + user->WriteNumeric(RPL_WHOISSERVER, parameters[0], (hide_server ? ServerInstance->Config->HideServer : u->server), signon); } } diff --git a/src/users.cpp b/src/users.cpp index ead862b7d..b3546a134 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1163,15 +1163,15 @@ void User::PurgeEmptyChannels() const std::string& FakeUser::GetFullHost() { - if (!ServerInstance->Config->HideWhoisServer.empty()) - return ServerInstance->Config->HideWhoisServer; + if (!ServerInstance->Config->HideServer.empty()) + return ServerInstance->Config->HideServer; return server->GetName(); } const std::string& FakeUser::GetFullRealHost() { - if (!ServerInstance->Config->HideWhoisServer.empty()) - return ServerInstance->Config->HideWhoisServer; + if (!ServerInstance->Config->HideServer.empty()) + return ServerInstance->Config->HideServer; return server->GetName(); } |