From 62e7254fbe791dc61ebbca0ab3c228f5c1e48994 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 10 Jun 2013 01:10:15 +0200 Subject: Fix high CPU use on Windows when connecting to a server When getting a write event for an EventHandler that wanted a single write only, remove it from the WriteSet (socketengine_select) Fixes #556 reported by @WindowsUser --- src/socketengines/socketengine_select.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/socketengines/socketengine_select.cpp b/src/socketengines/socketengine_select.cpp index eba54a7cb..c21b200c2 100644 --- a/src/socketengines/socketengine_select.cpp +++ b/src/socketengines/socketengine_select.cpp @@ -179,7 +179,9 @@ int SelectEngine::DispatchEvents() if (has_write) { WriteEvents++; - SetEventMask(ev, ev->GetEventMask() & ~(FD_WRITE_WILL_BLOCK | FD_WANT_SINGLE_WRITE)); + int newmask = (ev->GetEventMask() & ~(FD_WRITE_WILL_BLOCK | FD_WANT_SINGLE_WRITE)); + this->OnSetEvent(ev, ev->GetEventMask(), newmask); + SetEventMask(ev, newmask); ev->HandleEvent(EVENT_WRITE); } } -- cgit v1.2.3 From 20e521a9eade796b119b5f7e7bde45541149915c Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 12 Jun 2013 18:11:51 +0200 Subject: m_spanningtree FJOIN handler: Merge and take maxmodes into consideration when applying non-prefix modes --- src/modules/m_spanningtree/fjoin.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index c0475613a..ee18c8e87 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -121,19 +121,38 @@ CmdResult CommandFJoin::Handle(const std::vector& params, User *src /* First up, apply their modes if they won the TS war */ if (apply_other_sides_modes) { - unsigned int idx = 2; + // Need to use a modestacker here due to maxmodes + irc::modestacker stack(true); + std::vector::const_iterator paramit = params.begin() + 3; + const std::vector::const_iterator lastparamit = ((params.size() > 3) ? (params.end() - 1) : params.end()); + for (std::string::const_iterator i = params[2].begin(); i != params[2].end(); ++i) + { + ModeHandler* mh = ServerInstance->Modes->FindMode(*i, MODETYPE_CHANNEL); + if (!mh) + continue; + + std::string modeparam; + if ((paramit != lastparamit) && (mh->GetNumParams(true))) + { + modeparam = *paramit; + ++paramit; + } + + stack.Push(*i, modeparam); + } + std::vector modelist; // Mode parser needs to know what channel to act on. modelist.push_back(params[0]); - /* Remember, params[params.size() - 1] is nicklist, and we don't want to apply *that* */ - for (idx = 2; idx != (params.size() - 1); idx++) + while (stack.GetStackedLine(modelist)) { - modelist.push_back(params[idx]); + ServerInstance->Modes->Process(modelist, srcuser, true); + modelist.erase(modelist.begin() + 1, modelist.end()); } - ServerInstance->SendMode(modelist, srcuser); + ServerInstance->Modes->Process(modelist, srcuser, true); } /* Now, process every 'modes,nick' pair */ -- cgit v1.2.3 From 913724d7319bcd6883e3755224ce66b963de4bf4 Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Thu, 20 Jun 2013 14:26:22 -0300 Subject: Prevent m_cgiirc from blocking indefinitely, resulting in registration timeouts on e.g. Mibbit when webirc is not used --- src/modules/m_cgiirc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index d4ef602b3..ccbaaae32 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -207,8 +207,8 @@ class ModuleCgiIRC : public Module { bool cached; CGIResolver* r = new CGIResolver(this, cmd.notify, newip, user, (was_pass ? "PASS" : "IDENT"), cached, waiting); - ServerInstance->AddResolver(r, cached); waiting.set(user, waiting.get(user) + 1); + ServerInstance->AddResolver(r, cached); } catch (...) { -- cgit v1.2.3 From 805b7d3effc71d44665c0a7f590343c84e03db92 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 7 Jul 2013 16:25:11 +0100 Subject: Fix low risk crash when we can't determine maximum open socket count. --- src/inspircd.cpp | 2 +- src/socketengines/socketengine_epoll.cpp | 4 ++-- src/socketengines/socketengine_kqueue.cpp | 4 ++-- src/socketengines/socketengine_poll.cpp | 2 +- src/socketengines/socketengine_ports.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 1403cdef5..9516449a0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -241,7 +241,7 @@ void InspIRCd::SetSignals() void InspIRCd::QuickExit(int status) { - exit(0); + exit(status); } bool InspIRCd::DaemonSeed() diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index f7e107e7b..6913076a2 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -63,7 +63,7 @@ EPollEngine::EPollEngine() { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets!"); std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl; - ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } // This is not a maximum, just a hint at the eventual number of sockets that may be polled. @@ -75,7 +75,7 @@ EPollEngine::EPollEngine() ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now."); std::cout << "ERROR: Could not initialize epoll socket engine: " << strerror(errno) << std::endl; std::cout << "ERROR: Your kernel probably does not have the proper features. This is a fatal error, exiting now." << std::endl; - ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } ref = new EventHandler* [GetMaxFds()]; diff --git a/src/socketengines/socketengine_kqueue.cpp b/src/socketengines/socketengine_kqueue.cpp index e24146943..8694a0bdd 100644 --- a/src/socketengines/socketengine_kqueue.cpp +++ b/src/socketengines/socketengine_kqueue.cpp @@ -74,7 +74,7 @@ KQueueEngine::KQueueEngine() { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets!"); std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl; - ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } this->RecoverFromFork(); @@ -97,7 +97,7 @@ void KQueueEngine::RecoverFromFork() ServerInstance->Logs->Log("SOCKET",DEFAULT, "ERROR: this is a fatal error, exiting now."); std::cout << "ERROR: Could not initialize socket engine. Your kernel probably does not have the proper features." << std::endl; std::cout << "ERROR: this is a fatal error, exiting now." << std::endl; - ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } CurrentSetSize = 0; } diff --git a/src/socketengines/socketengine_poll.cpp b/src/socketengines/socketengine_poll.cpp index 5c361a0cb..4f4f60b4e 100644 --- a/src/socketengines/socketengine_poll.cpp +++ b/src/socketengines/socketengine_poll.cpp @@ -107,7 +107,7 @@ PollEngine::PollEngine() { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets: %s", strerror(errno)); std::cout << "ERROR: Can't determine maximum number of open sockets: " << strerror(errno) << std::endl; - ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } #endif diff --git a/src/socketengines/socketengine_ports.cpp b/src/socketengines/socketengine_ports.cpp index 52d799ddf..f7c547d45 100644 --- a/src/socketengines/socketengine_ports.cpp +++ b/src/socketengines/socketengine_ports.cpp @@ -77,7 +77,7 @@ PortsEngine::PortsEngine() { ServerInstance->Logs->Log("SOCKET", DEFAULT, "ERROR: Can't determine maximum number of open sockets!"); std::cout << "ERROR: Can't determine maximum number of open sockets!" << std::endl; - ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } EngineHandle = port_create(); @@ -87,7 +87,7 @@ PortsEngine::PortsEngine() ServerInstance->Logs->Log("SOCKET",SPARSE,"ERROR: This is a fatal error, exiting now."); std::cout << "ERROR: Could not initialize socket engine: " << strerror(errno) << std::endl; std::cout << "ERROR: This is a fatal error, exiting now." << std::endl; - ServerInstance->Exit(EXIT_STATUS_SOCKETENGINE); + ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } CurrentSetSize = 0; -- cgit v1.2.3 From 525a104ef8a639c254d8960b620fe3eb22b34667 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 7 Jul 2013 16:33:31 +0100 Subject: Fix the Poll socket engine on BSD. --- src/socketengines/socketengine_poll.cpp | 42 +++++++++------------------------ 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/src/socketengines/socketengine_poll.cpp b/src/socketengines/socketengine_poll.cpp index 4f4f60b4e..ea7780686 100644 --- a/src/socketengines/socketengine_poll.cpp +++ b/src/socketengines/socketengine_poll.cpp @@ -35,15 +35,15 @@ #include "socketengine.h" #ifndef _WIN32 - #ifndef __USE_XOPEN - #define __USE_XOPEN /* fuck every fucking OS ever made. needed by poll.h to work.*/ - #endif - #include - #include +# ifndef __USE_XOPEN +# define __USE_XOPEN /* fuck every fucking OS ever made. needed by poll.h to work.*/ +# endif +# include +# include +# include #else - /* *grumble* */ - #define struct pollfd WSAPOLLFD - #define poll WSAPoll +# define struct pollfd WSAPOLLFD +# define poll WSAPoll #endif class InspIRCd; @@ -76,32 +76,13 @@ public: #endif -#ifdef BSD - #include -#else - #include -#endif - PollEngine::PollEngine() { CurrentSetSize = 0; -#ifdef BSD - int mib[2]; - size_t len; - - mib[0] = CTL_KERN; -#ifdef KERN_MAXFILESPERPROC - mib[1] = KERN_MAXFILESPERPROC; -#else - mib[1] = KERN_MAXFILES; -#endif - len = sizeof(MAX_DESCRIPTORS); - sysctl(mib, 2, &MAX_DESCRIPTORS, &len, NULL, 0); -#else - int max = ulimit(4, 0); - if (max > 0) + struct rlimit limits; + if (!getrlimit(RLIMIT_NOFILE, &limits)) { - MAX_DESCRIPTORS = max; + MAX_DESCRIPTORS = limits.rlim_cur; } else { @@ -109,7 +90,6 @@ PollEngine::PollEngine() std::cout << "ERROR: Can't determine maximum number of open sockets: " << strerror(errno) << std::endl; ServerInstance->QuickExit(EXIT_STATUS_SOCKETENGINE); } -#endif ref = new EventHandler* [GetMaxFds()]; events = new struct pollfd[GetMaxFds()]; -- cgit v1.2.3 From 7dd381f568938971e9c69a074def5da058d5c242 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 19 Jun 2013 21:53:12 +0200 Subject: Do not send too much data over SSL in one go Some clients fail to read it entirely and the remaining data stays in their read buffer until new data arrives --- src/inspsocket.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index d78ace318..410f928d9 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -248,11 +248,13 @@ void StreamSocket::DoWrite() // The length limit of 1024 is to prevent merging strings // more than once when writes begin to block. std::string tmp; - tmp.reserve(sendq_len); - for(unsigned int i=0; i < sendq.size(); i++) - tmp.append(sendq[i]); - sendq.clear(); - sendq.push_back(tmp); + tmp.reserve(1280); + while (!sendq.empty() && tmp.length() < 1024) + { + tmp.append(sendq.front()); + sendq.pop_front(); + } + sendq.push_front(tmp); } std::string& front = sendq.front(); int itemlen = front.length(); -- cgit v1.2.3 From be23ca74e47887d5e4306a82c214db42fff0a944 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 9 Jul 2013 17:34:10 +0200 Subject: m_userip Fix incorrect "variable may be used uninitialized" warning shown by older GCC versions --- src/modules/m_userip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index bfac36b1a..5ea84c04a 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -38,7 +38,7 @@ class CommandUserip : public Command std::string retbuf = "340 " + user->nick + " :"; int nicks = 0; bool checked_privs = false; - bool has_privs; + bool has_privs = false; for (int i = 0; i < (int)parameters.size(); i++) { -- cgit v1.2.3 From 2a9aa9be8ac4a97ce766c797aff76abf135bb139 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Fri, 12 Jul 2013 19:30:33 +0200 Subject: Clean up error handling in threadengine_win32 --- src/threadengines/threadengine_win32.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp index 529e24a29..ea37892f8 100644 --- a/src/threadengines/threadengine_win32.cpp +++ b/src/threadengines/threadengine_win32.cpp @@ -35,17 +35,11 @@ void ThreadEngine::Start(Thread* thread) if (data->handle == NULL) { + DWORD lasterr = GetLastError(); thread->state = NULL; delete data; - std::string err = "Unable to create new thread: "; -#ifdef _WIN32 - CHAR errdetail[100]; - FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errdetail, 100, 0); + std::string err = "Unable to create new thread: " + ConvToStr(lasterr); SetLastError(ERROR_SUCCESS); - err += errdetail; -#else - err += dlerror(); -#endif throw CoreException(err); } } -- cgit v1.2.3 From 6e0b904d342461cd2ac2a3cd0cf2a43d864d2b00 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 3 Jul 2013 17:26:45 -0400 Subject: Use the correct socket related error messages on Windows --- include/socketengine.h | 8 ++++++++ src/inspsocket.cpp | 10 +++++----- src/socketengine.cpp | 23 +++++++++++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/include/socketengine.h b/include/socketengine.h index 2fc3cdbfd..37b7d6373 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -494,6 +494,14 @@ public: * Checks EAGAIN and WSAEWOULDBLOCK */ static bool IgnoreError(); + + /** Return the last socket related error. strrerror(errno) on *nix + */ + static std::string LastError(); + + /** Returns the error for the given error num, strerror(errnum) on *nix + */ + static std::string GetError(int errnum); }; inline bool SocketEngine::IgnoreError() diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 410f928d9..356904f74 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -56,7 +56,7 @@ void BufferedSocket::DoConnect(const std::string &ipaddr, int aport, unsigned lo if (err != I_ERR_NONE) { state = I_ERROR; - SetError(strerror(errno)); + SetError(SocketEngine::LastError()); OnError(err); } } @@ -210,7 +210,7 @@ void StreamSocket::DoRead() } else { - error = strerror(errno); + error = SocketEngine::LastError(); ServerInstance->SE->ChangeEventMask(this, FD_WANT_NO_READ | FD_WANT_NO_WRITE); } } @@ -296,7 +296,7 @@ void StreamSocket::DoWrite() if (errno == EINTR || SocketEngine::IgnoreError()) ServerInstance->SE->ChangeEventMask(this, FD_WANT_FAST_WRITE | FD_WRITE_WILL_BLOCK); else - SetError(strerror(errno)); + SetError(SocketEngine::LastError()); return; } else if (rv < itemlen) @@ -401,7 +401,7 @@ void StreamSocket::DoWrite() } else { - error = strerror(errno); + error = SocketEngine::LastError(); } } if (!error.empty()) @@ -496,7 +496,7 @@ void StreamSocket::HandleEvent(EventType et, int errornum) if (errornum == 0) SetError("Connection closed"); else - SetError(strerror(errornum)); + SetError(SocketEngine::GetError(errornum)); switch (errornum) { case ETIMEDOUT: diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 6c99edc95..8af598b06 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -255,3 +255,26 @@ void SocketEngine::GetStats(float &kbitpersec_in, float &kbitpersec_out, float & kbitpersec_in = in_kbit / 1024; kbitpersec_out = out_kbit / 1024; } + +std::string SocketEngine::LastError() +{ +#ifndef _WIN32 + return strerror(errno); +#else + char szErrorString[500]; + DWORD dwErrorCode = WSAGetLastError(); + if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)szErrorString, _countof(szErrorString), NULL) == 0) + sprintf_s(szErrorString, _countof(szErrorString), "Error code: %u", dwErrorCode); + return szErrorString; +#endif +} + +std::string SocketEngine::GetError(int errnum) +{ +#ifndef _WIN32 + return strerror(errnum); +#else + WSASetLastError(errnum); + return LastError(); +#endif +} -- cgit v1.2.3 From 561f4f642e5bc391300dd33989c3624986808ed8 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 16 Jul 2013 22:30:18 +0200 Subject: m_ssl_openssl Fix inverted check that prevented certificates from being recognized as trusted --- src/modules/extra/m_ssl_openssl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index b63fcd376..7b7de023c 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -615,7 +615,7 @@ class ModuleSSLOpenSSL : public Module certinfo->invalid = (SSL_get_verify_result(session->sess) != X509_V_OK); - if (SelfSigned) + if (!SelfSigned) { certinfo->unknownsigner = false; certinfo->trusted = true; -- cgit v1.2.3 From 457d5da6925bf996ae3504e89b7f182b855cf017 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 20 Jul 2013 18:45:35 +0200 Subject: Fix generated snomask mode change string being incosistent with the input in certain cases, spotted by @Robby- --- src/users.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/users.cpp b/src/users.cpp index 2305ba8ce..18a356ef8 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -88,12 +88,12 @@ std::string User::ProcessNoticeMasks(const char *sm) this->SetNoticeMask(*c, adding); output += *c; + oldadding = adding; } } else this->WriteNumeric(ERR_UNKNOWNSNOMASK, "%s %c :is unknown snomask char to me", this->nick.c_str(), *c); - oldadding = adding; break; } -- cgit v1.2.3 From 1be212b865b3cab816cd3cb49b527add3cac6826 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 26 Jul 2013 07:33:45 -0400 Subject: Use server ids when propagating squits --- src/modules/m_spanningtree/treesocket1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 6582ba060..cb2c93548 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -189,9 +189,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) if (!Current->GetSocket() || Current->GetSocket()->Introduced()) { parameterlist params; - params.push_back(Current->GetName()); + params.push_back(Current->GetID()); params.push_back(":"+reason); - Utils->DoOneToAllButSender(Current->GetParent()->GetName(),"SQUIT",params,Current->GetName()); + Utils->DoOneToAllButSender(Current->GetParent()->GetID(),"SQUIT",params,Current->GetID()); } if (Current->GetParent() == Utils->TreeRoot) -- cgit v1.2.3 From 5f223beeaee91d8827454475c4ef6f679af4385d Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 13 Aug 2013 14:10:04 +0200 Subject: m_ssl_gnutls Fix feature testing and cipher suite related errors on older GnuTLS versions Use the (old) LIBGNUTLS_VERSION_* defines as a fallback when GNUTLS_VERSION_* is unavailable Fixes #595 reported by @rhylan --- src/modules/extra/m_ssl_gnutls.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 41e9d0c3d..1f1297ef9 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -44,8 +44,14 @@ /* $LinkerFlags: rpath("pkg-config --libs gnutls") pkgconflibs("gnutls","/libgnutls.so","-lgnutls") exec("libgcrypt-config --libs") */ /* $NoPedantic */ +#ifndef GNUTLS_VERSION_MAJOR +#define GNUTLS_VERSION_MAJOR LIBGNUTLS_VERSION_MAJOR +#define GNUTLS_VERSION_MINOR LIBGNUTLS_VERSION_MINOR +#define GNUTLS_VERSION_PATCH LIBGNUTLS_VERSION_PATCH +#endif + // These don't exist in older GnuTLS versions -#if ((GNUTLS_VERSION_MAJOR > 2) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR > 1) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR == 1 && GNUTLS_VERSION_MICRO >= 7)) +#if ((GNUTLS_VERSION_MAJOR > 2) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR > 1) || (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR == 1 && GNUTLS_VERSION_PATCH >= 7)) #define GNUTLS_NEW_PRIO_API #endif @@ -570,6 +576,8 @@ class ModuleSSLGnuTLS : public Module #ifdef GNUTLS_NEW_PRIO_API gnutls_priority_set(session->sess, priority); + #else + gnutls_set_default_priority(session->sess); #endif gnutls_credentials_set(session->sess, GNUTLS_CRD_CERTIFICATE, x509_cred); gnutls_dh_set_prime_bits(session->sess, dh_bits); -- cgit v1.2.3 From 3afddb6a34ec7be67d5e9f49de1919ac40770d73 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 21 Aug 2013 16:35:29 +0200 Subject: m_dnsbl Fix possible use-after-free after a rehash --- src/modules/m_dnsbl.cpp | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 5e02dd0a5..3a9360380 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -27,7 +27,7 @@ /* $ModDesc: Provides handling of DNS blacklists */ /* Class holding data for a single entry */ -class DNSBLConfEntry +class DNSBLConfEntry : public refcountbase { public: enum EnumBanaction { I_UNKNOWN, I_KILL, I_ZLINE, I_KLINE, I_GLINE, I_MARK }; @@ -51,11 +51,11 @@ class DNSBLResolver : public Resolver std::string theiruid; LocalStringExt& nameExt; LocalIntExt& countExt; - DNSBLConfEntry *ConfEntry; + reference ConfEntry; public: - DNSBLResolver(Module *me, LocalStringExt& match, LocalIntExt& ctr, const std::string &hostname, LocalUser* u, DNSBLConfEntry *conf, bool &cached) + DNSBLResolver(Module *me, LocalStringExt& match, LocalIntExt& ctr, const std::string &hostname, LocalUser* u, reference conf, bool &cached) : Resolver(hostname, DNS_QUERY_A, cached, me), theiruid(u->uuid), nameExt(match), countExt(ctr), ConfEntry(conf) { } @@ -209,7 +209,7 @@ class DNSBLResolver : public Resolver class ModuleDNSBL : public Module { - std::vector DNSBLConfEntries; + std::vector > DNSBLConfEntries; LocalStringExt nameExt; LocalIntExt countExt; @@ -243,36 +243,22 @@ class ModuleDNSBL : public Module ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - virtual ~ModuleDNSBL() - { - ClearEntries(); - } - Version GetVersion() { return Version("Provides handling of DNS blacklists", VF_VENDOR); } - /** Clear entries and free the mem it was using - */ - void ClearEntries() - { - for (std::vector::iterator i = DNSBLConfEntries.begin(); i != DNSBLConfEntries.end(); i++) - delete *i; - DNSBLConfEntries.clear(); - } - /** Fill our conf vector with data */ void ReadConf() { - ClearEntries(); + DNSBLConfEntries.clear(); ConfigTagList dnsbls = ServerInstance->Config->ConfTags("dnsbl"); for(ConfigIter i = dnsbls.first; i != dnsbls.second; ++i) { ConfigTag* tag = i->second; - DNSBLConfEntry *e = new DNSBLConfEntry(); + reference e = new DNSBLConfEntry(); e->name = tag->getString("name"); e->ident = tag->getString("ident"); @@ -337,11 +323,7 @@ class ModuleDNSBL : public Module /* add it, all is ok */ DNSBLConfEntries.push_back(e); - continue; } - - /* delete and drop it, error somewhere */ - delete e; } } @@ -420,7 +402,7 @@ class ModuleDNSBL : public Module unsigned long total_hits = 0, total_misses = 0; - for (std::vector::iterator i = DNSBLConfEntries.begin(); i != DNSBLConfEntries.end(); i++) + for (std::vector >::const_iterator i = DNSBLConfEntries.begin(); i != DNSBLConfEntries.end(); ++i) { total_hits += (*i)->stats_hits; total_misses += (*i)->stats_misses; -- cgit v1.2.3 From d3b6538f955e824d46141f64fc081ce19fc081ef Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 21 Aug 2013 16:38:33 +0200 Subject: m_spanningtree When an IOHook goes away close all pending connections that use it --- src/modules/m_spanningtree/main.cpp | 7 +++++++ src/modules/m_spanningtree/utils.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 7c93e7d45..ce1792a02 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -815,6 +815,13 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod) sock->Close(); } } + + for (SpanningTreeUtilities::TimeoutList::const_iterator i = Utils->timeoutlist.begin(); i != Utils->timeoutlist.end(); ++i) + { + TreeSocket* sock = i->first; + if (sock->GetIOHook() == mod) + sock->Close(); + } } // note: the protocol does not allow direct umode +o except diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 92a03428f..a0543b6bd 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -50,6 +50,8 @@ typedef std::map TreeServerList; class SpanningTreeUtilities : public classbase { public: + typedef std::map > TimeoutList; + /** Creator module */ ModuleSpanningTree* Creator; @@ -90,7 +92,7 @@ class SpanningTreeUtilities : public classbase server_hash sidlist; /** List of all outgoing sockets and their timeouts */ - std::map > timeoutlist; + TimeoutList timeoutlist; /** Holds the data from the tags in the conf */ std::vector > LinkBlocks; -- cgit v1.2.3 From 00cd97160ae8909ca12b8807a8114cad1f6a06b1 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 27 Aug 2013 18:30:59 +0200 Subject: Update example configs, README.md and more - Fix typos, remove misleading information, rephrase a few sentences - Add info about hmac- hash types - Remove (the code which used this was removed in 96e4434 - @SaberUK) - Change inspircd.github.org to inspircd.org --- README.md | 4 +- docs/conf/censor.conf.example | 8 +-- docs/conf/filter.conf.example | 2 +- docs/conf/helpop-full.conf.example | 2 +- docs/conf/helpop.conf.example | 2 +- docs/conf/inspircd.conf.example | 22 +++---- docs/conf/links.conf.example | 7 +-- docs/conf/modules.conf.example | 98 ++++++++++++++----------------- docs/conf/modules/charybdis.conf.example | 24 +++----- docs/conf/modules/unrealircd.conf.example | 28 ++++----- docs/conf/motd.txt.example | 2 +- docs/conf/opermotd.txt.example | 2 +- docs/conf/opers.conf.example | 14 +++-- src/modules/m_ircv3.cpp | 2 +- 14 files changed, 93 insertions(+), 124 deletions(-) diff --git a/README.md b/README.md index 2f77c5c15..caadad82d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,6 @@ many different users. ### Links -* [Website](http://inspircd.github.com) -* [GitHub]( https://github.com/inspircd) +* [Website](http://inspircd.org) +* [GitHub](https://github.com/inspircd) * [IRC](irc://irc.chatspike.net/inspircd) \ No newline at end of file diff --git a/docs/conf/censor.conf.example b/docs/conf/censor.conf.example index 342ccd875..ea9e08147 100644 --- a/docs/conf/censor.conf.example +++ b/docs/conf/censor.conf.example @@ -1,11 +1,9 @@ -# Configuration file for m_censor.so (1.0.0.0) -# C.J.Edwards May 2004. -# +# Configuration file for m_censor.so # The tags for this module are formatted as follows: # -# +# # # You can specify # to block lines containing the word diff --git a/docs/conf/filter.conf.example b/docs/conf/filter.conf.example index 922f55fb6..8f5d20c24 100644 --- a/docs/conf/filter.conf.example +++ b/docs/conf/filter.conf.example @@ -1,4 +1,4 @@ -# Configuration file for m_filter.so and m_filter_pcre.so +# Configuration file for m_filter.so # The tags for this module are formatted as follows: # diff --git a/docs/conf/helpop-full.conf.example b/docs/conf/helpop-full.conf.example index bc9326e62..1b33004c4 100644 --- a/docs/conf/helpop-full.conf.example +++ b/docs/conf/helpop-full.conf.example @@ -764,7 +764,7 @@ Closes all unregistered connections to the local server."> c Blocks private messages and notices from users who do not share a common channel with you (requires commonchans module). - d Deaf mode. User will not recieve any messages or notices + d Deaf mode. User will not receive any messages or notices from channels they are in (requires deaf module). g In combination with /allow, provides for server side ignore (requires callerid module). diff --git a/docs/conf/helpop.conf.example b/docs/conf/helpop.conf.example index 02ddff8a2..2cccc5a2c 100644 --- a/docs/conf/helpop.conf.example +++ b/docs/conf/helpop.conf.example @@ -77,7 +77,7 @@ LOCKSERV UNLOCKSERV JUMPSERVER"> c Blocks private messages and notices from users who do not share a common channel with you (requires commonchans module). - d Deaf mode. User will not recieve any messages or notices + d Deaf mode. User will not receive any messages or notices from channels they are in (requires deaf module). g In combination with /allow, provides for server side ignore (requires callerid module). diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index ca61bb416..9512e17c4 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -132,12 +132,9 @@ # |_| \_\___|\__,_|\__,_| |_| |_| |_|_|___/ |____/|_|\__(_) # # # # If you want to link servers to InspIRCd you must load the # -# m_spanningtree.so module! Please see the modules list below for # +# m_spanningtree.so module! Please see the modules list for # # information on how to load this module! If you do not load this # -# module, server ports will NOT be bound! # -# # -# PLEASE NOTE: If you have build InspIRCd with IPv6 support, you MUST # -# specify a bind address if you want the IRCd to bind to a IPv4 IP. # +# module, server ports will NOT work! # #hash="sha256" @@ -626,13 +625,10 @@ # # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Block color module: Blocking color-coded messages with cmode +c +# Block color module: Blocking color-coded messages with chan mode +c # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -274,7 +274,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # CallerID module: Adds usermode +g which activates hybrid-style -# callerid (== block all private messages unless you /accept first) +# callerid: block all private messages unless you /accept first # # #-#-#-#-#-#-#-#-#-#-#- CALLERID CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# @@ -398,7 +398,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Channel Names module: Allows disabling channels which have certain -# characters in the channel name such as bold, colorcodes, etc which +# characters in the channel name such as bold, colorcodes, etc. which # can be quite annoying and allow users to on occasion have a channel # that looks like the name of another channel on the network. # @@ -530,8 +530,8 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Clones module: Adds an oper command /CLONES for detecting cloned -# users. Warning: This module may be resource intensive when its -# command is issued, use with care. +# users. Warning: This command may be resource intensive when it is +# issued, use with care. # This module is oper-only. # To use, CLONES must be in one of your oper class blocks. # @@ -580,7 +580,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Channel cycle module. Server side /hop, with +ilk etc bypass. +# Channel cycle module. Server side /hop, with +ilk etc. bypass. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -619,8 +619,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Custom prefixes: allows for channel prefixes to be added. -# This can replace m_chanprotect and m_halfop, except for services that -# recognise those modules by name +# This replaces m_chanprotect and m_halfop. # # # name The name of the mode, must be unique from other modes @@ -631,9 +630,11 @@ # ranktoset The numeric rank required to set/unset this mode. Defaults to rank. # depriv Can you remove the mode from yourself? Defaults to yes. # -# +# # # +# +# Do /reloadmodule m_customprefix.so after changing the settings of this module. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Custom title module: Adds the /TITLE command which allows for trusted @@ -722,7 +723,7 @@ # Glob masks are accepted here also. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Devoice Module: Let users devoice themselves. +# Devoice Module: Let users devoice themselves using /devoice #chan. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -829,7 +830,7 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# HIDECHANS module: Allows opers to hide their channels list from non- +# HIDECHANS module: Allows users to hide their channels list from non- # opers by setting user mode +I on themselves. # # @@ -937,7 +938,7 @@ # # The following block can be used to control which extensions are # enabled. -# +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Join flood module: Adds support for join flood protection (+j) @@ -1073,7 +1074,7 @@ # are specified in a tag that the oper is part of. This is so # # you can control who has access to this possible dangerous command. # # If your server is locked and you get disconnected, do a REHASH from # -# shell to open up again. +# shell to open up again. # # # This module is oper-only. # @@ -1082,7 +1083,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Map hiding module: replaces /MAP and /LINKS output to users with a # # message to see a website, set by maphide="http://link.to/site" in # -# the security tag, instead. # +# the tag, instead. # # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1175,10 +1176,10 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# No nicks module: Adds the +N channel mode, as well as the +b N: -# extended bantype. +N stops all users from changing their nick, -# the +b N: extban stops anyone from matching a +b N:nick!user@host -# mask from changing their nick. +# No nicks module: Adds the +N channel mode, as well as the N extban. +# +N stops all users from changing their nick, the N extban stops +# anyone from matching a +b N:nick!user@host mask from changing their +# nick. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1192,7 +1193,7 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Network buisness join module +# Network business join module # Allows an oper to join a channel using /OJOIN, giving them +Y on the # channel which makes them immune to kick/deop/etc. # @@ -1224,7 +1225,7 @@ # If you are using the m_operjoin.so module, specify options here: # # # # channel - The channel name to join, can also be a comma # -# seperated list eg. "#channel1,#channel2". # +# separated list eg. "#channel1,#channel2". # # # # override - Lets the oper join walking thru any modes that # # might be set, even bans. Use "yes" or "no". # @@ -1256,7 +1257,7 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Oper MOTD module: Provides support for seperate message of the day +# Oper MOTD module: Provides support for separate message of the day # on oper-up # This module is oper-only. # @@ -1288,7 +1289,7 @@ # Oper levels module: Gives each oper a level and prevents # actions being taken against higher level opers # Specify the level as the 'level' parameter of the tag -# # This module is oper-only. +# This module is oper-only. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1315,7 +1316,7 @@ # You can also use $user for the user ident string. forwardmsg="NOTICE $nick :*** Forwarding PASS to $nickrequired" - # cmd: Command for the nick to run when it recieves a connect + # cmd: Command for the nick to run when it receives a connect # password. cmd="PRIVMSG $nickrequired :IDENTIFY $pass"> @@ -1395,7 +1396,7 @@ # Optional - If you specify to use the m_randquote.so module, then # # specify below the path to the randquotes.conf file. # # # -# +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Redirect module: Adds channel redirection (mode +L) # @@ -1427,8 +1428,8 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Regular Expression Provider for POSIX Regular Expressions. # You shouldn't need any additional libraries on a POSIX-compatible -# system (ie: any Linux, BSD, but not Windows). You must have at least -# 1 provider loaded to use m_filter or m_rline. +# system (i.e.: any Linux, BSD, but not Windows). You must have at +# least 1 provider loaded to use m_filter or m_rline. # On POSIX-compliant systems, regex syntax can be found by using the # command: 'man 7 regex'. # @@ -1597,7 +1598,7 @@ # and is similar in operation to the way asuka and ircu handle services. # # At the same time, this offers +r for users and channels to mark them -# as identified seperately from the idea of a master account, which +# as identified separately from the idea of a master account, which # can be useful for services which are heavily nick-as-account centric. # # This replaces m_services from 1.1 and earlier. @@ -1624,8 +1625,6 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SETNAME module: Adds the /SETNAME command -# This module is oper-only. -# To use, SETNAME must be in one of your oper class blocks. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1645,7 +1644,7 @@ # it directly affects the mode object itself. # @@ -1671,20 +1670,16 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# GnuTLS ssl module: Adds support for client-server SSL using GnuTLS, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# GnuTLS SSL module: Adds support for SSL connections using GnuTLS, +# if enabled. You must answer 'yes' in ./configure when asked or +# manually symlink the source for this module from the directory +# src/modules/extra, if you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_gnutls.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_gnutls # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SSL Info module: Allows users to retrieve information about other @@ -1702,20 +1697,16 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# OpenSSL ssl module: Adds support for client-server SSL using OpenSSL, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# OpenSSL SSL module: Adds support for SSL connections using OpenSSL, +# if enabled. You must answer 'yes' in ./configure when asked or symlink +# the source for this module from the directory src/modules/extra, if +# you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_openssl.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_openssl # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Strip color module: Adds the channel mode +S @@ -1798,7 +1789,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Test line module: Adds the /TLINE command, used to test how many -# users a /GLINE or /ZLINE etc would match. +# users a /GLINE or /ZLINE etc. would match. # This module is oper-only. # To use, TLINE must be in one of your oper class blocks. # @@ -1811,10 +1802,9 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # UHNAMES support module: Adds support for the IRCX style UHNAMES # extension, which displays ident and hostname in the names list for -# each user, saving clients from doing a WHO on the channel. Note that -# this module is not widely supported yet. If a client does not support -# UHNAMES it will not enable it, this will not break incompatible -# clients. +# each user, saving clients from doing a WHO on the channel. +# If a client does not support UHNAMES it will not enable it, this will +# not break incompatible clients. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -1824,8 +1814,8 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Userip module: Adds the /USERIP command -# This module is oper-only. -# To use, USERIP must be in one of your oper class blocks. +# Allows users to query their own IP, also allows opers to query the IP +# of anyone else. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# diff --git a/docs/conf/modules/charybdis.conf.example b/docs/conf/modules/charybdis.conf.example index 4490d5482..b456278bb 100644 --- a/docs/conf/modules/charybdis.conf.example +++ b/docs/conf/modules/charybdis.conf.example @@ -257,20 +257,16 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# GnuTLS ssl module: Adds support for client-server SSL using GnuTLS, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# GnuTLS SSL module: Adds support for SSL connections using GnuTLS, +# if enabled. You must answer 'yes' in ./configure when asked or +# manually symlink the source for this module from the directory +# src/modules/extra, if you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_gnutls.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_gnutls # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SSL Info module: Allows users to retrieve information about other @@ -288,20 +284,16 @@ # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# OpenSSL ssl module: Adds support for client-server SSL using OpenSSL, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# OpenSSL SSL module: Adds support for SSL connections using OpenSSL, +# if enabled. You must answer 'yes' in ./configure when asked or symlink +# the source for this module from the directory src/modules/extra, if +# you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_openssl.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_openssl # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # diff --git a/docs/conf/modules/unrealircd.conf.example b/docs/conf/modules/unrealircd.conf.example index fa5d652f1..65896808f 100644 --- a/docs/conf/modules/unrealircd.conf.example +++ b/docs/conf/modules/unrealircd.conf.example @@ -248,7 +248,7 @@ # If you are using the m_operjoin.so module, specify options here: # # # # channel - The channel name to join, can also be a comma # -# seperated list eg. "#channel1,#channel2". # +# separated list eg. "#channel1,#channel2". # # # # override - Lets the oper join walking thru any modes that # # might be set, even bans. Use "yes" or "no". # @@ -263,7 +263,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# Oper MOTD module: Provides support for seperate message of the day +# Oper MOTD module: Provides support for separate message of the day # on oper-up # This module is oper-only. # @@ -374,38 +374,30 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# GnuTLS ssl module: Adds support for client-server SSL using GnuTLS, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# GnuTLS SSL module: Adds support for SSL connections using GnuTLS, +# if enabled. You must answer 'yes' in ./configure when asked or symlink +# the source for this module from the directory src/modules/extra, if +# you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_gnutls.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_gnutls # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -# OpenSSL ssl module: Adds support for client-server SSL using OpenSSL, -# if enabled. You must copy the source for this module from the directory -# src/modules/extra, or answer 'yes' in ./configure when asked if you -# want to enable this, or it will not load. +# OpenSSL SSL module: Adds support for SSL connections using OpenSSL, +# if enabled. You must answer 'yes' in ./configure when asked or symlink +# the source for this module from the directory src/modules/extra, if +# you want to enable this, or it will not load. # # #-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-# # # # m_ssl_openssl.so is too complex it describe here, see the wiki: # # http://wiki.inspircd.org/Modules/ssl_openssl # -# # -# NOTE: If you want to use this module to encrypt and sign your # -# server to server traffic, you MUST load it before m_spanningtree in # -# your configuration file! # diff --git a/docs/conf/motd.txt.example b/docs/conf/motd.txt.example index 70830b8da..66fddd344 100644 --- a/docs/conf/motd.txt.example +++ b/docs/conf/motd.txt.example @@ -29,7 +29,7 @@ / * Web: http://www.inspircd.org \ | * IRC: irc.inspircd.org #inspircd | | * Docs: http://wiki.inspircd.org | - | * Bugs: http://inspircd.github.com/bugs | + | * Bugs: http://inspircd.org/bugs | | | | We hope you like this software. Please do | | make sure you put some effort into | diff --git a/docs/conf/opermotd.txt.example b/docs/conf/opermotd.txt.example index c91b36a2b..110cba8e4 100644 --- a/docs/conf/opermotd.txt.example +++ b/docs/conf/opermotd.txt.example @@ -29,7 +29,7 @@ / * Web: http://www.inspircd.org \ | * IRC: irc.inspircd.org #inspircd | | * Docs: http://wiki.inspircd.org | - | * Bugs: http://inspircd.github.com/bugs | + | * Bugs: http://inspircd.org/bugs | | | | We hope you like this software. Please do | | make sure you put some effort into | diff --git a/docs/conf/opers.conf.example b/docs/conf/opers.conf.example index 1e5abefa5..6cd00a409 100644 --- a/docs/conf/opers.conf.example +++ b/docs/conf/opers.conf.example @@ -27,9 +27,9 @@ # - channels/high-join-limit: allows opers with this priv to join total channels instead of total channels. # PERMISSIONS: # - users/flood/no-throttle: allows opers with this priv to send commands without being throttled (*NOTE) - # - users/flood/increased-buffers: allows opers with this priv to send and recieve data without worrying about being disconnected for exceeding limits (*NOTE) + # - users/flood/increased-buffers: allows opers with this priv to send and receive data without worrying about being disconnected for exceeding limits (*NOTE) # - # *NOTE: These privs are potantially dangerous, as they grant users with them the ability to hammer your server's CPU/RAM as much as they want, essentially. + # *NOTE: These privs are potentially dangerous, as they grant users with them the ability to hammer your server's CPU/RAM as much as they want, essentially. privs="users/auspex channels/auspex servers/auspex users/mass-message channels/high-join-limit users/flood/no-throttle users/flood/increased-buffers" # usermodes: Oper-only usermodes that opers with this class can use. @@ -138,10 +138,12 @@ # Remember: This is case sensitive name="Brain" - # hash: what hash this password is hashed with. requires the module - # for selected hash (m_md5.so, m_sha256.so or m_ripemd160.so) be - # loaded and the password hashing module (m_password_hash.so) - # loaded. Options here are: "md5", "sha256" and "ripemd160". + # hash: what hash this password is hashed with. + # Requires the module for selected hash (m_md5.so, m_sha256.so + # or m_ripemd160.so) be loaded and the password hashing module + # (m_password_hash.so) loaded. + # Options here are: "md5", "sha256" and "ripemd160", or one of + # these prefixed with "hmac-", e.g.: "hmac-sha256". # Create hashed password with: /mkpasswd hash="sha256" diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp index b0e020c63..da42d823d 100644 --- a/src/modules/m_ircv3.cpp +++ b/src/modules/m_ircv3.cpp @@ -88,7 +88,7 @@ class ModuleIRCv3 : public Module void OnRehash(User* user) { ConfigTag* conf = ServerInstance->Config->ConfValue("ircv3"); - accountnotify = conf->getBool("accoutnotify", true); + accountnotify = conf->getBool("accountnotify", conf->getBool("accoutnotify", true)); awaynotify = conf->getBool("awaynotify", true); extendedjoin = conf->getBool("extendedjoin", true); } -- cgit v1.2.3 From b55c842c9d8730e50865fb7dd98bce4aa85af0d7 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 9 Jul 2013 19:49:10 +0200 Subject: m_permchannels Construct the final line that will be saved in a std::string in WriteDatabase() --- src/modules/m_permchannels.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index a59518b28..bd65c5822 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -51,13 +51,13 @@ static bool WriteDatabase() fputs("# Permchannels DB\n# This file is autogenerated; any changes will be overwritten!\n\n", f); // Now, let's write. + std::string line; for (chan_hash::const_iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); i++) { Channel* chan = i->second; if (!chan->IsModeSet('P')) continue; - char line[1024]; const char* items[] = { "\n" }; - int lpos = 0, item = 0, ipos = 0; - while (lpos < 1022 && item < 7) + line.clear(); + int item = 0, ipos = 0; + while (item < 7) { char c = items[item][ipos++]; if (c == 0) @@ -82,12 +83,14 @@ static bool WriteDatabase() } else if (c == '\\' || c == '"') { - line[lpos++] = '\\'; + line += '\\'; } - line[lpos++] = c; + line += c; } - line[--lpos] = 0; - fputs(line, f); + + // Erase last '"' + line.erase(line.end()-1); + fputs(line.c_str(), f); } int write_error = 0; -- cgit v1.2.3 From 86f8294c2de86b8d060abbb02f7c51c0ca0d9ead Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 9 Jul 2013 20:01:03 +0200 Subject: m_permchannels Save channel TS, topic set time and set by information When loading, ignore and log channels with a name longer than Limits.MaxChan --- src/modules/m_permchannels.cpp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index bd65c5822..1bcb2ac17 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -58,12 +58,20 @@ static bool WriteDatabase() if (!chan->IsModeSet('P')) continue; + std::string chants = ConvToStr(chan->age); + std::string topicts = ConvToStr(chan->topicset); const char* items[] = { "\n" @@ -71,7 +79,7 @@ static bool WriteDatabase() line.clear(); int item = 0, ipos = 0; - while (item < 7) + while (item < 13) { char c = items[item][ipos++]; if (c == 0) @@ -222,9 +230,9 @@ public: std::string topic = tag->getString("topic"); std::string modes = tag->getString("modes"); - if (channel.empty()) + if ((channel.empty()) || (channel.length() > ServerInstance->Config->Limits.ChanMax)) { - ServerInstance->Logs->Log("m_permchannels", DEBUG, "Malformed permchannels tag with empty channel name."); + ServerInstance->Logs->Log("m_permchannels", DEFAULT, "Ignoring permchannels tag with empty or too long channel name (\"" + channel + "\")"); continue; } @@ -232,19 +240,16 @@ public: if (!c) { - c = new Channel(channel, ServerInstance->Time()); - if (!topic.empty()) - { - c->SetTopic(NULL, topic, true); - - /* - * Due to the way protocol works in 1.2, we need to hack the topic TS in such a way that this - * topic will always win over others. - * - * This is scheduled for (proper) fixing in a later release, and can be removed at a later date. - */ - c->topicset = 42; - } + time_t TS = tag->getInt("ts"); + c = new Channel(channel, ((TS > 0) ? TS : ServerInstance->Time())); + + c->SetTopic(NULL, topic, true); + c->setby = tag->getString("topicsetby"); + unsigned int topicset = tag->getInt("topicts"); + // SetTopic() sets the topic TS to now, if there was no topicts saved then don't overwrite that with a 0 + if (topicset > 0) + c->topicset = topicset; + ServerInstance->Logs->Log("m_permchannels", DEBUG, "Added %s with topic %s", channel.c_str(), topic.c_str()); if (modes.empty()) -- cgit v1.2.3 From 261d5bb566f6383efea99e73c933a2af6f408341 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 9 Jul 2013 20:21:33 +0200 Subject: m_permchannels Add the ability to save listmodes --- docs/conf/modules.conf.example | 4 ++- src/modules/m_permchannels.cpp | 74 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 71cc9e8c6..54a667f34 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1357,7 +1357,9 @@ # whenever +P is set, unset, or the topic/modes on a +P channel is changed. # If you want to do this, set the filename below, and uncomment the include. # -# +# If 'listmodes' is true then all list modes (+b, +I, +e, +g...) will be +# saved. Defaults to false. +# # # # You may also create channels on startup by using the block. diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 1bcb2ac17..04171585b 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -22,9 +22,15 @@ /* $ModDesc: Provides support for channel mode +P to provide permanent channels */ +struct ListModeData +{ + std::string modes; + std::string params; +}; + // Not in a class due to circular dependancy hell. static std::string permchannelsconf; -static bool WriteDatabase() +static bool WriteDatabase(Module* mod, bool save_listmodes) { FILE *f; @@ -58,6 +64,44 @@ static bool WriteDatabase() if (!chan->IsModeSet('P')) continue; + std::string chanmodes = chan->ChanModes(true); + if (save_listmodes) + { + ListModeData lm; + + // Bans are managed by the core, so we have to process them separately + lm.modes = std::string(chan->bans.size(), 'b'); + for (BanList::const_iterator j = chan->bans.begin(); j != chan->bans.end(); ++j) + { + lm.params += j->data; + lm.params += ' '; + } + + // All other listmodes are managed by modules, so we need to ask them (call their + // OnSyncChannel() handler) to give our ProtoSendMode() a list of modes that are + // set on the channel. The ListModeData struct is passed as an opaque pointer + // that will be passed back to us by the module handling the mode. + FOREACH_MOD(I_OnSyncChannel, OnSyncChannel(chan, mod, &lm)); + + if (!lm.modes.empty()) + { + // Remove the last space + lm.params.erase(lm.params.end()-1); + + // If there is at least a space in chanmodes (that is, a non-listmode has a parameter) + // insert the listmode mode letters before the space. Otherwise just append them. + std::string::size_type p = chanmodes.find(' '); + if (p == std::string::npos) + chanmodes += lm.modes; + else + chanmodes.insert(p, lm.modes); + + // Append the listmode parameters (the masks themselves) + chanmodes += ' '; + chanmodes += lm.params; + } + } + std::string chants = ConvToStr(chan->age); std::string topicts = ConvToStr(chan->topicset); const char* items[] = @@ -73,7 +117,7 @@ static bool WriteDatabase() " topicsetby=", chan->setby.c_str(), " modes=", - chan->ChanModes(true), + chanmodes.c_str(), ">\n" }; @@ -170,6 +214,7 @@ class ModulePermanentChannels : public Module { PermChannel p; bool dirty; + bool save_listmodes; public: ModulePermanentChannels() : p(this), dirty(false) @@ -213,7 +258,9 @@ public: virtual void OnRehash(User *user) { - permchannelsconf = ServerInstance->Config->ConfValue("permchanneldb")->getString("filename"); + ConfigTag* tag = ServerInstance->Config->ConfValue("permchanneldb"); + permchannelsconf = tag->getString("filename"); + save_listmodes = tag->getBool("listmodes"); } void LoadDatabase() @@ -296,7 +343,7 @@ public: void OnBackgroundTimer(time_t) { if (dirty) - WriteDatabase(); + WriteDatabase(this, save_listmodes); dirty = false; } @@ -332,6 +379,25 @@ public: } } + void ProtoSendMode(void* opaque, TargetTypeFlags type, void* target, const std::vector& modes, const std::vector& translate) + { + // We never pass an empty modelist but better be sure + if (modes.empty()) + return; + + ListModeData* lm = static_cast(opaque); + + // Append the mode letters without the trailing '+' (for example "IIII", "gg") + lm->modes.append(modes[0].begin()+1, modes[0].end()); + + // Append the parameters + for (std::vector::const_iterator i = modes.begin()+1; i != modes.end(); ++i) + { + lm->params += *i; + lm->params += ' '; + } + } + virtual Version GetVersion() { return Version("Provides support for channel mode +P to provide permanent channels",VF_VENDOR); -- cgit v1.2.3 From 25ab5612f2ed8f0163c338740abd9f133af89356 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Tue, 27 Aug 2013 18:33:32 +0200 Subject: Fix crash caused by passing a large integer to ctime() In addition to verifying the return value of localtime(), correct tm_year if it is out of bounds Reported by @JDowny --- src/commands/cmd_whowas.cpp | 13 +++---------- src/helperfuncs.cpp | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp index 17a779ec3..3a6444b45 100644 --- a/src/commands/cmd_whowas.cpp +++ b/src/commands/cmd_whowas.cpp @@ -58,14 +58,6 @@ CmdResult CommandWhowas::Handle (const std::vector& parameters, Use for (whowas_set::iterator ux = grp->begin(); ux != grp->end(); ux++) { WhoWasGroup* u = *ux; - time_t rawtime = u->signon; - tm *timeinfo; - char b[25]; - - timeinfo = localtime(&rawtime); - - strncpy(b,asctime(timeinfo),24); - b[24] = 0; user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick.c_str(),parameters[0].c_str(), u->ident.c_str(),u->dhost.c_str(),u->gecos.c_str()); @@ -74,10 +66,11 @@ CmdResult CommandWhowas::Handle (const std::vector& parameters, Use user->WriteNumeric(379, "%s %s :was connecting from *@%s", user->nick.c_str(), parameters[0].c_str(), u->host.c_str()); + std::string signon = ServerInstance->TimeString(u->signon); if (!ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex")) - user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), ServerInstance->Config->HideWhoisServer.c_str(), b); + user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), ServerInstance->Config->HideWhoisServer.c_str(), signon.c_str()); else - user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), u->server.c_str(), b); + user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(),parameters[0].c_str(), u->server.c_str(), signon.c_str()); } } else diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 5a8f55f11..439320c1e 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -495,7 +495,26 @@ bool InspIRCd::SilentULine(const std::string& sserver) std::string InspIRCd::TimeString(time_t curtime) { - return std::string(ctime(&curtime),24); +#ifdef _WIN32 + if (curtime < 0) + curtime = 0; +#endif + + struct tm* timeinfo = localtime(&curtime); + if (!timeinfo) + { + curtime = 0; + timeinfo = localtime(&curtime); + } + + // If the calculated year exceeds four digits or is less than the year 1000, + // the behavior of asctime() is undefined + if (timeinfo->tm_year + 1900 > 9999) + timeinfo->tm_year = 9999 - 1900; + else if (timeinfo->tm_year + 1900 < 1000) + timeinfo->tm_year = 0; + + return std::string(asctime(timeinfo),24); } // You should only pass a single character to this. -- cgit v1.2.3 From c92613ebf3c2e112bab2da62cc8d244d509bdda7 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 9 Jun 2013 14:11:41 +0200 Subject: Fix fd and minor memory leak in threadengine_pthread on unload of m_mysql --- src/threadengines/threadengine_pthread.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/threadengines/threadengine_pthread.cpp b/src/threadengines/threadengine_pthread.cpp index c1b964430..e16e401f3 100644 --- a/src/threadengines/threadengine_pthread.cpp +++ b/src/threadengines/threadengine_pthread.cpp @@ -80,6 +80,8 @@ class ThreadSignalSocket : public EventHandler ~ThreadSignalSocket() { + ServerInstance->SE->DelFd(this); + ServerInstance->SE->Close(GetFd()); } void Notify() @@ -104,6 +106,7 @@ class ThreadSignalSocket : public EventHandler SocketThread::SocketThread() { + signal.sock = NULL; int fd = eventfd(0, EFD_NONBLOCK); if (fd < 0) throw new CoreException("Could not create pipe " + std::string(strerror(errno))); @@ -127,6 +130,8 @@ class ThreadSignalSocket : public EventHandler ~ThreadSignalSocket() { close(send_fd); + ServerInstance->SE->DelFd(this); + ServerInstance->SE->Close(GetFd()); } void Notify() @@ -152,6 +157,7 @@ class ThreadSignalSocket : public EventHandler SocketThread::SocketThread() { + signal.sock = NULL; int fds[2]; if (pipe(fds)) throw new CoreException("Could not create pipe " + std::string(strerror(errno))); @@ -166,4 +172,9 @@ void SocketThread::NotifyParent() SocketThread::~SocketThread() { + if (signal.sock) + { + signal.sock->cull(); + delete signal.sock; + } } -- cgit v1.2.3 From 81a616cd9f7aeb130142859798d84ed3dda8c5c3 Mon Sep 17 00:00:00 2001 From: Christopher 'm4z' Holm Date: Sun, 25 Aug 2013 19:42:26 +0200 Subject: Update COPYING file with new FSF address. This should make rpmlint stop complaining about the incorrect FSF address. All changes taken from: http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt --- docs/COPYING | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/COPYING b/docs/COPYING index 1c8a914d4..6e2ceda85 100644 --- a/docs/COPYING +++ b/docs/COPYING @@ -7,14 +7,14 @@ ---------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -23,7 +23,7 @@ software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -63,8 +63,8 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE + + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -118,7 +118,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -176,7 +176,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -233,7 +233,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -263,7 +263,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -285,9 +285,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -299,7 +299,7 @@ convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -311,16 +311,16 @@ the "copyright" line and a pointer to where the full notice is found. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -343,5 +343,5 @@ necessary. Here is a sample; alter the names: This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. -- cgit v1.2.3 From 4d41afdc2ecf36017154e7a460457c076c8aaa16 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 28 Aug 2013 19:27:14 +0200 Subject: m_permchannels Fix empty topic setby --- src/modules/m_permchannels.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 04171585b..0a7dc8ed9 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -292,6 +292,8 @@ public: c->SetTopic(NULL, topic, true); c->setby = tag->getString("topicsetby"); + if (c->setby.empty()) + c->setby = ServerInstance->Config->ServerName; unsigned int topicset = tag->getInt("topicts"); // SetTopic() sets the topic TS to now, if there was no topicts saved then don't overwrite that with a 0 if (topicset > 0) -- cgit v1.2.3 From 5661a9eddbb86f22e40b70bef64581e590ed34c6 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 28 Aug 2013 19:29:50 +0200 Subject: Release 2.0.14 --- src/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.sh b/src/version.sh index 446246633..99d0d81d6 100755 --- a/src/version.sh +++ b/src/version.sh @@ -1,2 +1,2 @@ #!/bin/sh -echo "InspIRCd-2.0.13" +echo "InspIRCd-2.0.14" -- cgit v1.2.3 From d54eec6dd8d44cba3c1e935f72089dbe675e0820 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Fri, 30 Aug 2013 12:10:01 +0200 Subject: Don't CoreExport reference, fixes m_dnsbl on Windows The explicit instantiations of reference are now useless; remove --- include/base.h | 2 +- win/inspircd_win32wrapper.cpp | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/include/base.h b/include/base.h index 5308ed655..0a4456f3a 100644 --- a/include/base.h +++ b/include/base.h @@ -122,7 +122,7 @@ class CoreExport usecountbase }; template -class CoreExport reference +class reference { T* value; public: diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index 4592aa5d1..048baf38b 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -221,10 +221,3 @@ DWORD CWin32Exception::GetErrorCode() { return dwErrorCode; } - -#include "../src/modules/m_spanningtree/link.h" -#include "../src/modules/ssl.h" -template class reference; -template class reference; -template class reference; -template class reference; -- cgit v1.2.3