diff options
-rw-r--r-- | .mailmap | 42 | ||||
-rw-r--r-- | docs/conf/inspircd.conf.example | 3 | ||||
-rw-r--r-- | docs/conf/modules.conf.example | 6 | ||||
-rw-r--r-- | include/dynamic.h | 2 | ||||
-rw-r--r-- | src/coremods/core_xline/cmd_zline.cpp | 2 | ||||
-rw-r--r-- | src/coremods/core_xline/core_xline.cpp | 4 | ||||
-rw-r--r-- | src/dynamic.cpp | 15 | ||||
-rw-r--r-- | src/inspircd.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_blockcaps.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_noctcp.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_sasl.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_timedbans.cpp | 4 | ||||
-rw-r--r-- | src/xline.cpp | 12 |
14 files changed, 71 insertions, 33 deletions
diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..fa8fc8ee6 --- /dev/null +++ b/.mailmap @@ -0,0 +1,42 @@ +Adam <Adam@anope.org> Adam <adam@inspircd.org> +Adam <Adam@anope.org> Adam <adam@sigterm.info> +Attila Molnar <attilamolnar@hush.com> attilamolnar <am63770@gmail.com> +Attila Molnar <attilamolnar@hush.com> attilamolnar <attilamolnar@hush.com> +blitmap <blitternet@gmail.com> Pogs McPoggerson <sir.pogsalot@gmail.com> +blitmap <blitternet@gmail.com> Sir Poggles <sir.pogsalot@gmail.com> +blitmap <blitternet@gmail.com> Sir Pogsalot <sir.pogsalot@gmail.com> +ChrisTX <xpipe@hotmail.de> ChrisTX <chris@rev-crew.info> +Craig Edwards <brain@inspircd.org> (no author) <(no author)@e03df62e-2008-0410-955e-edbf42e46eb7> +Craig Edwards <brain@inspircd.org> brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> +Craig Edwards <brain@inspircd.org> root <root@e03df62e-2008-0410-955e-edbf42e46eb7> +Craig McLure <craig@frostycoolslug.com> frostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7> +Daniel De Graaf <danieldg@inspircd.org> danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> +Daniel Vassdal <shutter@canternet.org> Daniel Vassdal <daniel@daniel-VirtualBox.(none)> +Daniel Vassdal <shutter@canternet.org> ShutterQuick <shutter@canternet.org> +Dennis Friis <peavey@inspircd.org> peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> +DjSlash <djslash@djslash.org> Rutger <djslash+github@djslash.org> +Geoff Bricker <geoff.bricker@gmail.com> bricker <bricker@e03df62e-2008-0410-955e-edbf42e46eb7> +jackmcbarn <jackmcbarn@inspircd.org> Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org> +John Brooks <special@inspircd.org> special <special@e03df62e-2008-0410-955e-edbf42e46eb7> +Justin Crawford <Justasic@Gmail.com> Justasic <Justasic@gmail.com> +Matt Smith <dz@inspircd.org> dz <dz@e03df62e-2008-0410-955e-edbf42e46eb7> +Oliver Lupton <om@inspircd.org> om <om@e03df62e-2008-0410-955e-edbf42e46eb7> +Pippijn van Steenhoven <pip88nl@gmail.com> pippijn <pippijn@e03df62e-2008-0410-955e-edbf42e46eb7> +Robby <robby@chatbelgie.be> Robby- <robby@chat.be> +Robby <robby@chatbelgie.be> Robby- <robbyke@gmail.com> +Robin Burchell <robin+git@viroteck.net> Robin Burchell <viroteck@viroteck.net> +Robin Burchell <robin+git@viroteck.net> w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> +Thomas Stagner <aquanight@inspircd.org> aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> +Uli Schlachter <psychon@inspircd.org> psychon <psychon@e03df62e-2008-0410-955e-edbf42e46eb7> +William Pitcock <nenolod@dereferenced.org> nenolod <nenolod@e03df62e-2008-0410-955e-edbf42e46eb7> + +# The identities of the following people could not be verified: +# +# burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7> +# eggy <eggy@e03df62e-2008-0410-955e-edbf42e46eb7> +# fez <fez@e03df62e-2008-0410-955e-edbf42e46eb7> +# jamie <jamie@e03df62e-2008-0410-955e-edbf42e46eb7> +# katsklaw <katsklaw@e03df62e-2008-0410-955e-edbf42e46eb7> +# Philouuu <philsliders@laptop.(none)> / PhilSliderS <philsliders@laptop.(none)> +# randomdan <randomdan@e03df62e-2008-0410-955e-edbf42e46eb7> +# typobox43 <typobox43@e03df62e-2008-0410-955e-edbf42e46eb7> diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index c90cf5755..c08982b98 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -417,7 +417,8 @@ # represented as 192.168.1.0/24). This means that abuse across an ISP # # is detected and curtailed much easier. Here is a good chart that # # shows how many IPs the different CIDRs correspond to: # -# http://en.wikipedia.org/wiki/CIDR#Prefix_aggregation # +# https://en.wikipedia.org/wiki/IPv4_subnetting_reference # +# https://en.wikipedia.org/wiki/IPv6_subnetting_reference # # # <cidr diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 383c6a173..a555d8be2 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1694,7 +1694,7 @@ # as shown below: # #<securehost exception="*@*.netsplit.de"> #<securehost exception="*@*.ircdriven.com"> -#<securehost exception="*@*.irc-source.com"> +#<securehost exception="*@*.ircs.me"> # # # Define the following variable to change how long a user must wait # # before issuing a LIST. If not defined, defaults to 60 seconds. # @@ -1826,7 +1826,7 @@ # You can optionally let the user know that their command was blocked. # # You may also let SHUN affect opers (defaults to no). -#<shun enabledcommands="PING PONG QUIT PART JOIN" notifyuser="yes" affectopers="no"> +#<shun enabledcommands="ADMIN PING PONG QUIT PART JOIN" notifyuser="yes" affectopers="no"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SSL channel mode module: Adds support for SSL-only channels via @@ -1899,7 +1899,7 @@ # SQLite3 module: Allows other SQL modules to access SQLite3 # # databases through a unified API. # # This module is in extras. Re-run configure with: # -# ./configure --enable-extras=m_sqlite.cpp +# ./configure --enable-extras=m_sqlite3.cpp # and run make install, then uncomment this module to enable it. # # #<module name="sqlite3"> diff --git a/include/dynamic.h b/include/dynamic.h index d42cf61bf..905eb479e 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -32,11 +32,9 @@ class CoreExport DLLManager : public classbase */ std::string err; -#ifdef _WIN32 /** Sets the last error string */ void RetrieveLastError(); -#endif public: /** This constructor loads the module using dlopen() diff --git a/src/coremods/core_xline/cmd_zline.cpp b/src/coremods/core_xline/cmd_zline.cpp index 1bc7e8afd..af9d54a5b 100644 --- a/src/coremods/core_xline/cmd_zline.cpp +++ b/src/coremods/core_xline/cmd_zline.cpp @@ -103,5 +103,5 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User bool CommandZline::IPMatcher::Check(User* user, const std::string& ip) const { - return InspIRCd::Match(user->GetIPString(), ip, ascii_case_insensitive_map); + return InspIRCd::MatchCIDR(user->GetIPString(), ip, ascii_case_insensitive_map); } diff --git a/src/coremods/core_xline/core_xline.cpp b/src/coremods/core_xline/core_xline.cpp index 93ac1db31..d6c804748 100644 --- a/src/coremods/core_xline/core_xline.cpp +++ b/src/coremods/core_xline/core_xline.cpp @@ -46,8 +46,8 @@ bool InsaneBan::MatchesEveryone(const std::string& mask, MatcherBase& test, User bool InsaneBan::IPHostMatcher::Check(User* user, const std::string& mask) const { - return ((InspIRCd::Match(user->MakeHost(), mask, ascii_case_insensitive_map)) || - (InspIRCd::Match(user->MakeHostIP(), mask, ascii_case_insensitive_map))); + return ((InspIRCd::MatchCIDR(user->MakeHost(), mask, ascii_case_insensitive_map)) || + (InspIRCd::MatchCIDR(user->MakeHostIP(), mask, ascii_case_insensitive_map))); } class CoreModXLine : public Module diff --git a/src/dynamic.cpp b/src/dynamic.cpp index 340f40e19..f138b04d1 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -43,11 +43,7 @@ DLLManager::DLLManager(const char *fname) h = dlopen(fname, RTLD_NOW|RTLD_LOCAL); if (!h) { -#ifdef _WIN32 RetrieveLastError(); -#else - err = dlerror(); -#endif } } @@ -72,11 +68,7 @@ Module* DLLManager::CallInit() initfn.vptr = dlsym(h, MODULE_INIT_STR); if (!initfn.vptr) { -#ifdef _WIN32 RetrieveLastError(); -#else - err = dlerror(); -#endif return NULL; } @@ -94,18 +86,21 @@ std::string DLLManager::GetVersion() return ""; } -#ifdef _WIN32 void DLLManager::RetrieveLastError() { +#if defined _WIN32 char errmsg[500]; DWORD dwErrorCode = GetLastError(); if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)errmsg, _countof(errmsg), NULL) == 0) sprintf_s(errmsg, _countof(errmsg), "Error code: %u", dwErrorCode); SetLastError(ERROR_SUCCESS); err = errmsg; +#else + char* errmsg = dlerror(); + err = errmsg ? errmsg : "Unknown error"; +#endif std::string::size_type p; while ((p = err.find_last_of("\r\n")) != std::string::npos) err.erase(p, 1); } -#endif diff --git a/src/inspircd.cpp b/src/inspircd.cpp index bc0875502..47660f752 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -642,8 +642,15 @@ void InspIRCd::Run() OLDTIME = TIME.tv_sec; if ((TIME.tv_sec % 3600) == 0) + { FOREACH_MOD(OnGarbageCollect, ()); + // HACK: ELines are not expired properly at the moment but it can't be fixed as + // the 2.0 XLine system is a spaghetti nightmare. Instead we skip over expired + // ELines in XLineManager::CheckELines() and expire them here instead. + XLines->GetAll("E"); + } + Timers.TickTimers(TIME.tv_sec); Users->DoBackgroundUserStuff(); diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index 6e67cb309..c26d92caa 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -56,7 +56,7 @@ public: { if (target_type == TYPE_CHANNEL) { - if ((!IS_LOCAL(user)) || (text.length() < minlen)) + if ((!IS_LOCAL(user)) || (text.length() < minlen) || (text == "\1ACTION\1") || (text == "\1ACTION")) return MOD_RES_PASSTHRU; Channel* c = (Channel*)dest; diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 305801b0a..d8dbe6da7 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -107,7 +107,7 @@ class CommandWebIRC : public SplitCommand realip.set(user, user->GetIPString()); // Check if we're happy with the provided hostname. If it's problematic then make sure we won't set a host later, just the IP - bool host_ok = (parameters[2].length() <= ServerInstance->Config->Limits.MaxHost); + bool host_ok = (parameters[2].length() <= ServerInstance->Config->Limits.MaxHost) && (parameters[2].find_first_not_of("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-") == std::string::npos); const std::string& newhost = (host_ok ? parameters[2] : parameters[3]); if (notify) diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 9dd9bf852..713964328 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -50,7 +50,7 @@ class ModuleNoCTCP : public Module if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user))) { Channel* c = (Channel*)dest; - if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ",8))) + if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ", 8)) || (text == "\1ACTION\1") || (text == "\1ACTION")) return MOD_RES_PASSTHRU; ModResult res; diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index fe1438ccf..eedf968b4 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -174,6 +174,7 @@ class SaslAuthenticator parameterlist params; params.push_back(user->host); params.push_back(user->GetIPString()); + params.push_back(SSLIOHook::IsSSL(&user->eh) ? "S" : "P"); SendSASL(user, "*", 'H', params); } diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 44c6c4c4f..9890800e4 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -118,8 +118,8 @@ class CommandTban : public Command TimedBanList.push_back(T); // If halfop is loaded, send notice to halfops and above, otherwise send to ops and above - ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL); - char pfxchar = (mh && mh->name == "halfop") ? '%' : '@'; + PrefixMode* mh = ServerInstance->Modes->FindPrefixMode('h'); + char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@'; channel->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); return CMD_SUCCESS; diff --git a/src/xline.cpp b/src/xline.cpp index b116d2e1f..257af9ca7 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -159,6 +159,7 @@ void XLineManager::CheckELines() for (UserManager::LocalList::const_iterator u2 = list.begin(); u2 != list.end(); u2++) { LocalUser* u = *u2; + u->exempt = false; /* This uses safe iteration to ensure that if a line expires here, it doenst trash the iterator */ LookupIter safei; @@ -169,7 +170,8 @@ void XLineManager::CheckELines() safei++; XLine *e = i->second; - u->exempt = e->Matches(u); + if ((!e->duration || ServerInstance->Time() < e->expiry) && e->Matches(u)) + u->exempt = true; i = safei; } @@ -323,14 +325,6 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User* void ELine::Unset() { - /* remove exempt from everyone and force recheck after deleting eline */ - const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); - for (UserManager::LocalList::const_iterator u2 = list.begin(); u2 != list.end(); u2++) - { - LocalUser* u = *u2; - u->exempt = false; - } - ServerInstance->XLines->CheckELines(); } |