summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/conf/modules.conf.example2
-rwxr-xr-xmake/calcdep.pl9
-rw-r--r--make/template/main.mk16
-rw-r--r--src/channels.cpp5
-rw-r--r--src/coremods/core_user/cmd_user.cpp12
-rw-r--r--src/inspircd.cpp6
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp5
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp16
8 files changed, 30 insertions, 41 deletions
diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example
index b573de903..b2d759ff8 100644
--- a/docs/conf/modules.conf.example
+++ b/docs/conf/modules.conf.example
@@ -642,7 +642,7 @@
#
# You can also override the configuration of prefix modes added by both the core
# and other modules by adding a customprefix tag with change="yes" specified.
-# <customprefix name="op" change="yes" rank="30000" ranktoset="30000"">
+# <customprefix name="op" change="yes" rank="30000" ranktoset="30000">
# <customprefix name="voice" change="yes" rank="10000" ranktoset="10000" depriv="no">
#
# Do /RELOADMODULE customprefix after changing the settings of this module.
diff --git a/make/calcdep.pl b/make/calcdep.pl
index 99355efa4..3b4ae6b0d 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -30,6 +30,8 @@ BEGIN {
use strict;
use warnings FATAL => qw(all);
+use File::Basename qw(basename);
+
use constant {
BUILDPATH => $ENV{BUILDPATH},
SOURCEPATH => $ENV{SOURCEPATH}
@@ -238,6 +240,10 @@ sub dep_so($) {
my($file) = @_;
my $out = find_output $file;
+ my $name = basename $out, '.so';
+ print MAKE ".PHONY: $name\n";
+ print MAKE "$name: $out\n";
+
dep_cpp $file, $out, 'gen-so';
return $out;
}
@@ -255,6 +261,9 @@ sub dep_dir($$) {
closedir DIR;
if (@ofiles) {
my $ofiles = join ' ', @ofiles;
+ my $name = basename $outdir;
+ print MAKE ".PHONY: $name\n";
+ print MAKE "$name: $outdir.so\n";
print MAKE "$outdir.so: $ofiles\n";
print MAKE "\t@\$(SOURCEPATH)/make/unit-cc.pl link-dir \$\@ ${\SOURCEPATH}/src/$dir \$^ \$>\n";
return 1;
diff --git a/make/template/main.mk b/make/template/main.mk
index 4845d0dde..077084280 100644
--- a/make/template/main.mk
+++ b/make/template/main.mk
@@ -137,15 +137,9 @@ export SOURCEPATH
# Default target
TARGET = all
-ifdef INSPIRCD_MODULE
+ifdef INSPIRCD_TARGET
HEADER = mod-header
FOOTER = mod-footer
- TARGET = modules/$(INSPIRCD_MODULE:.so=).so
-endif
-
-ifdef INSPIRCD_TARGET
- HEADER =
- FOOTER = target
TARGET = $(INSPIRCD_TARGET)
endif
@@ -178,10 +172,10 @@ debug-header:
mod-header:
ifdef INSPIRCD_STATIC
- @echo 'Cannot build single modules in pure-static build'
+ @echo 'Cannot build specific targets in pure-static build'
@exit 1
endif
- @echo 'Building single module:'
+ @echo 'Building specific targets:'
mod-footer: target
@echo 'To install, copy $(BUILDPATH)/$(TARGET) to $(MODPATH)'
@@ -308,9 +302,7 @@ help:
@echo ' Currently installs to ${BASE}'
@echo ' debug Compile a debug build. Equivalent to "make D=1 all"'
@echo ''
- @echo ' INSPIRCD_MODULE=m_foo Builds a single module (core_foo also works here)'
- @echo ' INSPIRCD_TARGET=target Builds a user-specified target, such as "inspircd" or "modules"'
- @echo ' Other targets are specified by their path in the build directory'
+ @echo ' INSPIRCD_TARGET=target Builds a user-specified target, such as "inspircd" or "core_dns"'
@echo ' Multiple targets may be separated by a space'
@echo ''
@echo ' clean Cleans object files produced by the compile'
diff --git a/src/channels.cpp b/src/channels.cpp
index 1151fe0a5..118a413a8 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -402,7 +402,10 @@ ModResult Channel::GetExtBanStatus(User *user, char type)
{
for (ListModeBase::ModeList::const_iterator it = bans->begin(); it != bans->end(); ++it)
{
- if (CheckBan(user, it->mask))
+ if (it->mask[0] != type || it->mask[1] != ':')
+ continue;
+
+ if (CheckBan(user, it->mask.substr(2)))
return MOD_RES_DENY;
}
}
diff --git a/src/coremods/core_user/cmd_user.cpp b/src/coremods/core_user/cmd_user.cpp
index 8bf34665d..c4cdd9b37 100644
--- a/src/coremods/core_user/cmd_user.cpp
+++ b/src/coremods/core_user/cmd_user.cpp
@@ -21,6 +21,12 @@
#include "inspircd.h"
#include "core_user.h"
+enum
+{
+ // From ircu.
+ ERR_INVALIDUSERNAME = 468
+};
+
CommandUser::CommandUser(Module* parent)
: SplitCommand(parent, "USER", 4, 4)
{
@@ -36,11 +42,7 @@ CmdResult CommandUser::HandleLocal(const std::vector<std::string>& parameters, L
{
if (!ServerInstance->IsIdent(parameters[0]))
{
- /*
- * RFC says we must use this numeric, so we do. Let's make it a little more nub friendly though. :)
- * -- Craig, and then w00t.
- */
- user->WriteNumeric(ERR_NEEDMOREPARAMS, name, "Your username is not valid");
+ user->WriteNumeric(ERR_INVALIDUSERNAME, name, "Your username is not valid");
return CMD_FAILURE;
}
else
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index d7b616ecc..0068a6fee 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -35,12 +35,6 @@
#include <sys/resource.h>
#include <dlfcn.h>
#include <getopt.h>
-
- /* Some systems don't define RUSAGE_SELF. This should fix them. */
- #ifndef RUSAGE_SELF
- #define RUSAGE_SELF 0
- #endif
-
#include <pwd.h> // setuid
#include <grp.h> // setgid
#else
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 97fdf504c..56b60de26 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -79,11 +79,6 @@
#define GNUTLS_NEW_PRIO_API
#endif
-#if (!INSPIRCD_GNUTLS_HAS_VERSION(2, 0, 0))
-typedef gnutls_certificate_credentials_t gnutls_certificate_credentials;
-typedef gnutls_dh_params_t gnutls_dh_params;
-#endif
-
enum issl_status { ISSL_NONE, ISSL_HANDSHAKING, ISSL_HANDSHAKEN };
#if INSPIRCD_GNUTLS_HAS_VERSION(2, 12, 0)
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index ae5e213b7..d203ad2f3 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -54,11 +54,6 @@
# pragma comment(lib, "libeay32.lib")
#endif
-#if ((OPENSSL_VERSION_NUMBER >= 0x10000000L) && (!(defined(OPENSSL_NO_ECDH))))
-// OpenSSL 0.9.8 includes some ECC support, but it's unfinished. Enable only for 1.0.0 and later.
-#define INSPIRCD_OPENSSL_ENABLE_ECDH
-#endif
-
// BIO is opaque in OpenSSL 1.1 but the access API does not exist in 1.0 and older.
#if ((defined LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x10100000L))
# define BIO_get_data(BIO) BIO->ptr
@@ -130,7 +125,7 @@ namespace OpenSSL
{
// Sane default options for OpenSSL see https://www.openssl.org/docs/ssl/SSL_CTX_set_options.html
// and when choosing a cipher, use the server's preferences instead of the client preferences.
- long opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_SINGLE_DH_USE;
+ long opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_SINGLE_DH_USE;
// Only turn options on if they exist
#ifdef SSL_OP_SINGLE_ECDH_USE
opts |= SSL_OP_SINGLE_ECDH_USE;
@@ -162,7 +157,7 @@ namespace OpenSSL
return (SSL_CTX_set_tmp_dh(ctx, dh.get()) >= 0);
}
-#ifdef INSPIRCD_OPENSSL_ENABLE_ECDH
+#ifndef OPENSSL_NO_ECDH
void SetECDH(const std::string& curvename)
{
int nid = OBJ_sn2nid(curvename.c_str());
@@ -291,9 +286,8 @@ namespace OpenSSL
if (!tag->getBool("compression", false)) // Disable compression by default
setoptions |= SSL_OP_NO_COMPRESSION;
#endif
- if (!tag->getBool("sslv3", false)) // Disable SSLv3 by default
- setoptions |= SSL_OP_NO_SSLv3;
- if (!tag->getBool("tlsv1", true))
+ // Disable TLSv1.0 by default.
+ if (!tag->getBool("tlsv1", false))
setoptions |= SSL_OP_NO_TLSv1;
if (!setoptions && !clearoptions)
@@ -331,7 +325,7 @@ namespace OpenSSL
}
}
-#ifdef INSPIRCD_OPENSSL_ENABLE_ECDH
+#ifndef OPENSSL_NO_ECDH
std::string curvename = tag->getString("ecdhcurve", "prime256v1");
if (!curvename.empty())
ctx.SetECDH(curvename);