From fad82c2e0d400aee8c11a51962cf0a522efa5d66 Mon Sep 17 00:00:00 2001 From: special Date: Sat, 7 Oct 2006 21:11:50 +0000 Subject: [PATCH] Replaced operonlystats with userstats to improve security git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5456 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/inspircd.conf.example | 13 ++++++------- include/configreader.h | 2 +- src/cmd_stats.cpp | 2 +- src/configreader.cpp | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example index deef4b18c..1d34c369c 100644 --- a/docs/inspircd.conf.example +++ b/docs/inspircd.conf.example @@ -614,12 +614,11 @@ # if defined sets a soft maxconnections value, has # # to be less than the ./configure maxclients # # # -# operonlystats - The operonlystats field is optional and specifies # -# which stats characters in /STATS may only be # -# requested by an IRC operator. Stats characters in # -# this field are case sensitive and enforced as # -# oper-only independent of if they are in a module # -# or the core. # +# userstats - The userstats field is optional and specifies # +# which stats characters in /STATS may be requested # +# by non-operators. Stats characters in this field # +# are case sensitive and are allowed to users # +# independent of if they are in a module or the core # # # # operspywhois - If this is set then when an IRC operator uses # # /WHOIS on a user they will see all channels, even # @@ -697,7 +696,7 @@ qaprefixes="0" somaxconn="128" softlimit="12800" - operonlystats="oclgkz" + userstats="Pu" operspywhois="no" customversion="" maxtargets="20" diff --git a/include/configreader.h b/include/configreader.h index be952f051..cce4e0f9d 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -361,7 +361,7 @@ class ServerConfig : public Extensible /** STATS characters in this list are available * only to operators. */ - char OperOnlyStats[MAXBUF]; + char UserStats[MAXBUF]; /** The path and filename of the ircd.log file */ diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index 338a1a2ac..6d2efd047 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -46,7 +46,7 @@ void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, string_lis { std::string sn = ServerInstance->Config->ServerName; - if ((*ServerInstance->Config->OperOnlyStats) && (strchr(ServerInstance->Config->OperOnlyStats,statschar)) && (!*user->oper)) + if ((*ServerInstance->Config->UserStats) && (!*user->oper) && (!strchr(ServerInstance->Config->UserStats,statschar))) { results.push_back(sn+std::string(" 481 ")+user->nick+" :Permission denied - STATS "+statschar+" is oper-only"); return; diff --git a/src/configreader.cpp b/src/configreader.cpp index 2c7067127..1059770b4 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -28,7 +28,7 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance) *TempDir = *ServerName = *Network = *ServerDesc = *AdminName = '\0'; *HideWhoisServer = *AdminEmail = *AdminNick = *diepass = *restartpass = '\0'; *CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0'; - *OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0'; + *UserStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0'; log_file = NULL; NoUserDns = forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false; CycleHosts = writelog = AllowHalfop = true; @@ -545,7 +545,7 @@ void ServerConfig::Read(bool bail, userrec* user) {"dns", "timeout", &this->dns_timeout, DT_INTEGER, ValidateDnsTimeout}, {"options", "moduledir", &this->ModPath, DT_CHARPTR, ValidateModPath}, {"disabled", "commands", &this->DisabledCommands, DT_CHARPTR, NoValidation}, - {"options", "operonlystats", &this->OperOnlyStats, DT_CHARPTR, NoValidation}, + {"options", "userstats", &this->UserStats, DT_CHARPTR, NoValidation}, {"options", "customversion", &this->CustomVersion, DT_CHARPTR, NoValidation}, {"options", "hidesplits", &this->HideSplits, DT_BOOLEAN, NoValidation}, {"options", "hidebans", &this->HideBans, DT_BOOLEAN, NoValidation}, -- 2.39.5