diff options
-rw-r--r-- | .travis.yml | 15 | ||||
-rwxr-xr-x | configure | 5 | ||||
-rw-r--r-- | docs/conf/modules.conf.example | 10 | ||||
-rwxr-xr-x | make/calcdep.pl | 2 | ||||
-rwxr-xr-x | modulemanager | 1 | ||||
-rw-r--r-- | src/modules/m_dnsbl.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_httpd_stats.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_sasl.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 15 | ||||
-rw-r--r-- | src/socketengines/socketengine_epoll.cpp | 9 | ||||
-rw-r--r-- | src/users.cpp | 2 | ||||
-rwxr-xr-x | tools/travis-ci.sh | 5 |
12 files changed, 52 insertions, 29 deletions
diff --git a/.travis.yml b/.travis.yml index 631802526..bb82add9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,13 @@ compiler: - - "clang" - - "gcc" -language: "cpp" + - clang + - gcc +dist: trusty +env: + - PURE_STATIC=1 + - +language: cpp notifications: email: false -os: - - "linux" - - "osx" script: - - "sh ./tools/travis-ci.sh" + - sh ./tools/travis-ci.sh sudo: required @@ -28,6 +28,7 @@ BEGIN { require 5.8.0; + push @INC, '.'; } use strict; @@ -876,6 +877,10 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; } if ($config{OSNAME} !~ /DARWIN/i) { print FILEHANDLE "#define HAS_CLOCK_GETTIME\n"; + } else { + print FILEHANDLE "#ifdef MAC_OS_X_VERSION_10_12\n"; + print FILEHANDLE "# define HAS_CLOCK_GETTIME\n"; + print FILEHANDLE "#endif\n"; } my $use_hiperf = 0; if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) { diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 97d69da90..acafb327c 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -421,6 +421,9 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Chanprotect module: Gives +q and +a channel modes. +# +# IMPORTANT: This module has been removed in the next major version of +# InspIRCd. You should use m_customprefix instead. #<module name="m_chanprotect.so"> <chanprotect @@ -519,6 +522,10 @@ # key3, key4; the values must be less than 0x80000000 and should be # # picked at random. Prefix is mandatory, will default to network name # # if not specified, and will always have a "-" appended. # +# # +# IMPORTANT: The compat-host and compat-ip modes have been removed in # +# the next major version of InspIRCd. You should ONLY use them if you # +# need backwards compatibility with InspIRCd 1.2. # # #<cloak mode="half" # key="secret" @@ -824,6 +831,9 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Halfop module: Provides the +h (halfops) channel status mode. +# +# IMPORTANT: This module has been removed in the next major version of +# InspIRCd. You should use m_customprefix instead. #<module name="m_halfop.so"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# diff --git a/make/calcdep.pl b/make/calcdep.pl index 4a759a24a..49506dd3b 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -160,7 +160,7 @@ END obj/ld-extra.cmd: $core_src \@\$(SOURCEPATH)/make/unit-cc.pl gen-ld\$(VERBOSE) \$\@ \$^ \$> -bin/inspircd: obj/ld-extra.cmd $core_mk +bin/inspircd: $core_mk obj/ld-extra.cmd \@\$(SOURCEPATH)/make/unit-cc.pl static-ld\$(VERBOSE) \$\@ \$^ \$> inspircd: bin/inspircd diff --git a/modulemanager b/modulemanager index af5bf113c..b107f2c1f 100755 --- a/modulemanager +++ b/modulemanager @@ -25,6 +25,7 @@ use warnings FATAL => qw(all); use make::configure; BEGIN { + push @INC, '.'; unless (module_installed("LWP::Simple")) { die "Your system is missing the LWP::Simple Perl module!"; } diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index d4101686a..3dea080ce 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -70,8 +70,8 @@ class DNSBLResolver : public Resolver int i = countExt.get(them); if (i) countExt.set(them, i - 1); - // Now we calculate the bitmask: 256*(256*(256*a+b)+c)+d - if(result.length()) + // All replies should be in 127.0.0.0/8 + if (result.compare(0, 4, "127.") == 0) { unsigned int bitmask = 0, record = 0; bool match = false; @@ -82,6 +82,7 @@ class DNSBLResolver : public Resolver switch (ConfEntry->type) { case DNSBLConfEntry::A_BITMASK: + // Now we calculate the bitmask: 256*(256*(256*a+b)+c)+d bitmask = resultip.s_addr >> 24; /* Last octet (network byte order) */ bitmask &= ConfEntry->bitmask; match = (bitmask != 0); @@ -196,7 +197,11 @@ class DNSBLResolver : public Resolver ConfEntry->stats_misses++; } else + { + if (!result.empty()) + ServerInstance->SNO->WriteGlobalSno('a', "DNSBL: %s returned address outside of acceptable subnet 127.0.0.0/8: %s", ConfEntry->domain.c_str(), result.c_str()); ConfEntry->stats_misses++; + } } } diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 2fc7ca7de..e17bf514f 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -213,7 +213,7 @@ class ModuleHttpStats : public Module data << "<server>"; data << "<servername>" << b->servername << "</servername>"; data << "<parentname>" << b->parentname << "</parentname>"; - data << "<gecos>" << b->gecos << "</gecos>"; + data << "<gecos>" << Sanitize(b->gecos) << "</gecos>"; data << "<usercount>" << b->usercount << "</usercount>"; // This is currently not implemented, so, commented out. // data << "<opercount>" << b->opercount << "</opercount>"; diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 16a15357f..649c21809 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -268,7 +268,7 @@ class ModuleSASL : public Module void init() { OnRehash(NULL); - Implementation eventlist[] = { I_OnEvent, I_OnUserRegister, I_OnRehash }; + Implementation eventlist[] = { I_OnEvent, I_OnUserConnect, I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); ServiceProvider* providelist[] = { &auth, &sasl, &authExt }; @@ -283,7 +283,7 @@ class ModuleSASL : public Module sasl_target = ServerInstance->Config->ConfValue("sasl")->getString("target", "*"); } - ModResult OnUserRegister(LocalUser *user) + void OnUserConnect(LocalUser *user) { SaslAuthenticator *sasl_ = authExt.get(user); if (sasl_) @@ -291,8 +291,6 @@ class ModuleSASL : public Module sasl_->Abort(); authExt.unset(user); } - - return MOD_RES_PASSTHRU; } Version GetVersion() diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index 3ab5dae9d..ca4147fea 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -137,9 +137,6 @@ void SpanningTreeProtocolInterface::PushToClient(User* target, const std::string void SpanningTreeProtocolInterface::SendChannel(Channel* target, char status, const std::string &text) { - std::string cname = target->name; - if (status) - cname = status + cname; TreeServerList list; CUList exempt_list; Utils->GetListOfServersForChannel(target,list,status,exempt_list); @@ -154,12 +151,20 @@ void SpanningTreeProtocolInterface::SendChannel(Channel* target, char status, co void SpanningTreeProtocolInterface::SendChannelPrivmsg(Channel* target, char status, const std::string &text) { - SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" PRIVMSG "+target->name+" :"+text); + std::string cname = target->name; + if (status) + cname.insert(0, 1, status); + + SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" PRIVMSG "+cname+" :"+text); } void SpanningTreeProtocolInterface::SendChannelNotice(Channel* target, char status, const std::string &text) { - SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" NOTICE "+target->name+" :"+text); + std::string cname = target->name; + if (status) + cname.insert(0, 1, status); + + SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" NOTICE "+cname+" :"+text); } void SpanningTreeProtocolInterface::SendUserPrivmsg(User* target, const std::string &text) diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp index f2837777a..d5f017347 100644 --- a/src/socketengines/socketengine_epoll.cpp +++ b/src/socketengines/socketengine_epoll.cpp @@ -25,7 +25,7 @@ #include "exitcodes.h" #include "socketengine.h" #include <sys/epoll.h> -#include <ulimit.h> +#include <sys/resource.h> #include <iostream> #define EP_DELAY 5 @@ -55,10 +55,11 @@ public: EPollEngine::EPollEngine() { CurrentSetSize = 0; - int max = ulimit(4, 0); - if (max > 0) + + struct rlimit limit; + if (!getrlimit(RLIMIT_NOFILE, &limit)) { - MAX_DESCRIPTORS = max; + MAX_DESCRIPTORS = limit.rlim_cur; } else { diff --git a/src/users.cpp b/src/users.cpp index 418f2c9aa..af0e15f65 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1398,6 +1398,8 @@ void User::DoHostCycle(const std::string &quitline) FOREACH_MOD(I_OnBuildNeighborList,OnBuildNeighborList(this, include_c, exceptions)); + // Users shouldn't see themselves quitting when host cycling + exceptions.erase(this); for (std::map<User*,bool>::iterator i = exceptions.begin(); i != exceptions.end(); ++i) { LocalUser* u = IS_LOCAL(i->first); diff --git a/tools/travis-ci.sh b/tools/travis-ci.sh index 6dbc82300..42b07fa25 100755 --- a/tools/travis-ci.sh +++ b/tools/travis-ci.sh @@ -4,11 +4,6 @@ if [ "$TRAVIS_OS_NAME" = "linux" ] then sudo apt-get update --assume-yes sudo apt-get install --assume-yes libgeoip-dev libgnutls-dev libldap2-dev libmysqlclient-dev libpcre3-dev libpq-dev libsqlite3-dev libssl-dev libtre-dev -elif [ "$TRAVIS_OS_NAME" = "osx" ] -then - brew update - brew install geoip gnutls mysql-connector-c openssl pcre postgresql sqlite3 tre - brew link sqlite3 --force else >&2 echo "'$TRAVIS_OS_NAME' is an unknown Travis CI environment!" exit 1 |