1
0
mirror of https://github.com/anope/anope.git synced 2026-06-16 05:24:47 +02:00

Compare commits

..

62 Commits

Author SHA1 Message Date
Sadie Powell 756dc49813 Release 2.1.6. 2024-06-01 09:43:36 +01:00
Sadie Powell aa92559aa0 Document the previous commit. 2024-06-01 09:43:20 +01:00
Sadie Powell eb12a89b8e Fix creating the runtime directory on Windows. 2024-05-28 01:07:27 +01:00
Sadie Powell d4a34308e5 Update the change logs. 2024-05-23 16:02:54 +01:00
Sadie Powell aab3a8e5b6 Clarify that one non-deprecated protocol module must be loaded. 2024-05-23 15:40:56 +01:00
Sadie Powell c72e12d0a6 Fix setting the history mode on UnrealIRCd.
Closes #406.
2024-05-22 15:08:13 +01:00
Sadie Powell bce0d629fd Fix another iterator invalidation issue. 2024-05-22 14:30:18 +01:00
Sadie Powell 7d0dacc86c Change --modulesdir to be singular like the other config options. 2024-05-22 10:30:03 +01:00
Sadie Powell 729aa4ab4a Fix parsing the flood mode on UnrealIRCd. 2024-05-18 18:36:17 +01:00
Sadie Powell 18e9e12261 Fix an iterator invalidation issue in cs_set and ns_set. 2024-05-18 16:35:35 +01:00
TehPeGaSuS 9d68b29c9e Initial Portuguese retranslation. 2024-05-17 17:24:24 +01:00
Sadie Powell a4792412ba Merge branch '2.0' into 2.1. 2024-05-16 18:00:13 +01:00
Sadie Powell 8bb83f6b1a Explicitly specify ROW_FORMAT=DYNAMIC when creating tables.
Resolves the issues some people were having with extremely wide rows.
2024-05-16 17:29:25 +01:00
Sadie Powell da99a53dfa Don't specify a width for DT_INT columns.
This isn't actually used by MySQL for the column width.
2024-05-16 17:28:15 +01:00
Sadie Powell a9e9ac32a0 Store boolean extension items as DT_INT. 2024-05-16 17:28:15 +01:00
Sadie Powell 05e6df23a2 Mark boolean columns as DT_INT in bs_kick. 2024-05-16 16:50:41 +01:00
Sadie Powell 3f9fc23270 Remove some unnecessary advice. 2024-05-16 16:44:38 +01:00
Sadie Powell cb21c7c1fa Fix some untranslated strings in the Turkish translation. 2024-05-11 18:35:17 +01:00
Sadie Powell 4008e64f26 Store when the account name was registered in the NickCore. 2024-05-11 17:40:38 +01:00
Sadie Powell 1cf5918574 Merge branch '2.0' into 2.1. 2024-05-11 14:24:37 +01:00
Sadie Powell afe87bf693 Ensure we are connected to MySQL before trying to escape data. 2024-05-11 11:36:29 +01:00
Sadie Powell ff1c5adb8b Always use server-side topic and mode locks where available. 2024-05-10 19:03:50 +01:00
Sadie Powell c36030c826 Remove CanSVSLogout and implement logout support on Plexus. 2024-05-09 18:54:40 +01:00
Sadie Powell 33a02b1223 Require a reason when throwing an exception. 2024-05-09 18:37:16 +01:00
Sadie Powell 68f4556609 Store an IP in CommandSource for IRC messages too. 2024-05-06 17:08:37 +01:00
Sadie Powell 23db58a303 Change badpasslimit from int to unsigned int. 2024-05-06 16:42:13 +01:00
Sadie Powell ee69dc3105 Fix parsing backup client certificate fingerprints on InspIRCd. 2024-05-01 21:21:19 +01:00
Sadie Powell e9243c3fde Add the ReplaceCert method to CertService. 2024-05-01 21:20:31 +01:00
Sadie Powell 4cfee23303 Simplify InspIRCd user metadata handler slightly. 2024-05-01 20:20:47 +01:00
Sadie Powell be3822523b Automatically add client certificates to the cert list on register. 2024-05-01 17:23:10 +01:00
dependabot[bot] 111f81aa95 Bump microsoft/setup-msbuild from 1.3 to 2
Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 1.3 to 2.
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/v1.3...v2)

---
updated-dependencies:
- dependency-name: microsoft/setup-msbuild
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 17:20:06 +01:00
Sadie Powell f12e1ad222 Bump for 2.1.6-git. 2024-05-01 14:37:06 +01:00
Sadie Powell 72318a6bf0 Release 2.1.5. 2024-05-01 14:16:09 +01:00
Sadie Powell 2f77cb38e2 Update the changelogs. 2024-05-01 14:15:17 +01:00
Sadie Powell 84ca4c0d27 Update the inspircd module for recent 1206 protocol changes. 2024-05-01 14:03:11 +01:00
Sadie Powell 1f9a197b18 Merge branch '2.0' into 2.1. 2024-04-29 08:36:23 +01:00
Sadie Powell 0c5bf51378 Skip serializing data without a type in db_flatfile. 2024-04-29 08:16:45 +01:00
Sadie Powell 1647968c50 Fix message truncation in global/global and global/server. 2024-04-28 08:52:16 +01:00
Sadie Powell 5473311bd7 Only enable os_noop on IRCDs that actually have a SendSVSNOOP impl. 2024-04-15 21:08:40 +01:00
Sadie Powell f3ebb67469 Make SendChannel abstract. 2024-04-15 21:00:10 +01:00
Sadie Powell 0d149ce195 Install a systemd service file on Linux. 2024-04-15 20:29:57 +01:00
Sadie Powell d68ba1b570 Implement support for BIGLINES on UnrealIRCd. 2024-04-15 20:05:43 +01:00
Sadie Powell 1877833e73 Bump Bahamut support to require 2.0 or newer. 2024-04-15 18:29:36 +01:00
Sadie Powell 63c3710785 Fix some missing translations in the tr_TR translation. 2024-04-15 15:32:19 +01:00
Sadie Powell 0043d137e5 Update the Turkish translation for the changes in 2.1.4.
Co-authored-by: CaPa CuL <capacul@gmail.com>
2024-04-15 15:26:55 +01:00
Sadie Powell 3e5d3c5bdc Avoid packaging unnecessary .lib files on Windows.
[skip alpine ci]
[skip ubuntu ci]
2024-04-15 12:41:56 +01:00
Sadie Powell 62deedfa75 Automatically upload the Windows package on release.
[skip alpine ci]
[skip ubuntu ci]
2024-04-15 11:57:40 +01:00
Sadie Powell 44af4eac6b Update the Windows CI to the latest Conan. 2024-04-15 11:11:40 +01:00
Sadie Powell 5fdc637327 Expand relative paths when installing. 2024-04-14 12:23:19 +01:00
Sadie Powell 7c93007aa6 Avoid duplicate entries in ReplaceCert. 2024-04-14 12:23:19 +01:00
Robert Scheck e8fee93a7e Fix a typo in the example configs. 2024-04-14 09:21:50 +01:00
Sadie Powell 260539e987 Add more documentation for overriding confirmation codes. 2024-04-07 15:52:24 +01:00
Sadie Powell 4603cd467b Add an operator privilege to allow overriding drop codes.
Closes #392
2024-04-05 14:14:10 +01:00
Sadie Powell 00549bc9b2 Merge branch '2.0' into 2.1. 2024-04-04 19:59:19 +01:00
Sadie Powell e0a6f7456b Fix extracting timestamps from UnrealIRCd MODE messages.
Oversight from commit 04e1a4f5c8.
2024-04-04 19:48:34 +01:00
Sadie Powell 5a54b37aeb Remove the g prefix from git hashes. 2024-04-04 14:16:21 +01:00
Sadie Powell 2e43665266 Log the services directory when chdiring to it. 2024-04-04 14:02:57 +01:00
Sadie Powell 8b4cd65e2a Fix erroring out when sendmailpath is empty.
This has a default now.
2024-04-02 16:52:41 +01:00
Sadie Powell c08aaa86d1 Sync the build system directory names with the core. 2024-04-02 16:52:41 +01:00
Sadie Powell 87a8af0ad7 Use the paths from the build system instead of hardcoding them. 2024-04-02 16:45:49 +01:00
Sadie Powell 4691dfa3f0 Bump for 2.1.5-git. 2024-04-01 11:26:07 +01:00
Sadie Powell d41764bfd6 Fix sending emails to nicks ending with a backslash. 2024-03-15 18:52:12 +00:00
56 changed files with 2938 additions and 5200 deletions
+15 -4
View File
@@ -2,6 +2,9 @@ name: Windows CI
on:
pull_request:
push:
release:
types:
- published
schedule:
- cron: '0 0 * * 0'
jobs:
@@ -12,12 +15,12 @@ jobs:
- uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.3
uses: microsoft/setup-msbuild@v2
- name: Setup Conan
uses: turtlebrowser/get-conan@v1.2
with:
version: 1.59.0
version: 1.64.0
- name: Install libraries
run: |
@@ -27,9 +30,17 @@ jobs:
run: |
mkdir ${{ github.workspace }}\build
cd ${{ github.workspace }}\build
cmake -A "x64" -G "Visual Studio 16 2019" ..
cmake -A "x64" -D "CMAKE_BUILD_TYPE=${{ github.event_name == 'release' && 'Release' || 'Debug' }}" -G "Visual Studio 16 2019" ..
- name: Build Anope
working-directory: ${{ github.workspace }}\build
run: |
msbuild PACKAGE.vcxproj /M:3 /P:Configuration=Release /P:Platform=x64 /VERBOSITY:MINIMAL
msbuild PACKAGE.vcxproj /M:3 /P:Configuration=${{ github.event_name == 'release' && 'Release' || 'Debug' }} /P:Platform=x64 /VERBOSITY:MINIMAL
- name: Upload installer
if: "${{ github.event_name == 'release' }}"
working-directory: ${{ github.workspace }}\build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} $(Get-ChildItem anope-*.exe)
+15 -12
View File
@@ -256,8 +256,8 @@ endif()
if(NOT BIN_DIR)
set(BIN_DIR "bin")
endif()
if(NOT DB_DIR)
set(DB_DIR "data")
if(NOT DATA_DIR)
set(DATA_DIR "data")
endif()
if(NOT DOC_DIR)
set(DOC_DIR "doc")
@@ -265,14 +265,14 @@ endif()
if(NOT CONF_DIR)
set(CONF_DIR "conf")
endif()
if(NOT LIB_DIR)
set(LIB_DIR "lib")
if(NOT MODULE_DIR)
set(MODULE_DIR "modules")
endif()
if(NOT LOCALE_DIR)
set(LOCALE_DIR "locale")
endif()
if(NOT LOGS_DIR)
set(LOGS_DIR "logs")
if(NOT LOG_DIR)
set(LOG_DIR "logs")
endif()
# Version number processing
@@ -350,15 +350,17 @@ set(SERVICES_BINARY "$<TARGET_FILE:${PROGRAM_NAME}>")
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
# At install time, create the following additional directories
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
get_filename_component(ABSOLUTE_DATA_DIR ${DATA_DIR} REALPATH BASE_DIR ${CMAKE_INSTALL_PREFIX})
get_filename_component(ABSOLUTE_LOG_DIR ${LOG_DIR} REALPATH BASE_DIR ${CMAKE_INSTALL_PREFIX})
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
if(WIN32)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/runtime\")")
endif()
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
if(NOT WIN32 AND RUNGROUP)
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")")
endif()
# On Windows platforms, install extra files
@@ -368,7 +370,8 @@ if(WIN32)
)
endif()
install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
get_filename_component(ABSOLUTE_MODULE_DIR ${MODULE_DIR} REALPATH BASE_DIR ${CMAKE_INSTALL_PREFIX})
install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}${ABSOLUTE_MODULE_DIR}\")")
# Only process the CPack section if we have CPack
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+4 -26
View File
@@ -265,26 +265,7 @@ serverinfo
* - solanum
* - unrealircd
*/
module
{
name = "inspircd"
/*
* Some protocol modules can enforce mode locks server-side. This reduces the spam caused by
* services immediately reversing mode changes for locked modes.
*
* If the protocol module you have loaded does not support this, this setting will have no effect.
*/
use_server_side_mlock = yes
/*
* Some protocol modules can enforce topic locks server-side. This reduces the spam caused by
* services immediately reversing topic changes.
*
* If the protocol module you have loaded does not support this, this setting will have no effect.
*/
use_server_side_topiclock = yes
}
module { name = "inspircd" }
/*
* [REQUIRED] Network Information
@@ -756,6 +737,7 @@ log
* chanserv/auspex - Can see any information with /CHANSERV INFO
* chanserv/no-register-limit - May register an unlimited number of channels and nicknames
* chanserv/kick - Can kick and ban users from channels through ChanServ
* chanserv/drop/override - Allows dropping channels without using a confirmation code
* memoserv/info - Can see any information with /MEMOSERV INFO
* memoserv/set-limit - Can set the limit of max stored memos on any user and channel
* memoserv/no-limit - Can send memos through limits and throttles
@@ -764,6 +746,7 @@ log
* nickserv/cert - Can modify other users certificate lists
* nickserv/confirm - Can confirm other users nicknames
* nickserv/drop - Can drop other users nicks
* nickserv/drop/override - Allows dropping nicks without using a confirmation code
* nickserv/recover - Can recover other users nicks
* operserv/config - Can modify services's configuration
* operserv/oper/modify - Can add and remove operators with at most the same privileges
@@ -1151,11 +1134,6 @@ module
* This is only useful with very large databases, with hundreds
* of thousands of objects, that have a noticeable delay from
* writing databases.
*
* If your database is large enough cause a noticeable delay when
* saving you should consider a more powerful alternative such
* as db_sql or db_redis, which incrementally update their
* databases asynchronously in real time.
*/
fork = no
}
@@ -1311,7 +1289,7 @@ module
* [EXTRA] enc_posix
*
* Provides verify-only support for passwords encrypted using the POSIX crypt()
* function. Load this if you are migratign from another services packages such
* function. Load this if you are migrating from another services packages such
* as Atheme. See https://en.wikipedia.org/wiki/Crypt_(C) for more information.
*
* You must load another encryption method before this to re-encrypt passwords
+6
View File
@@ -286,6 +286,12 @@ module
{
name = "ns_cert"
/*
* Should users who are connected with a SSL client certificate have its fingerprint be added to
* their account when they register. Defaults to yes.
*/
automatic = yes
/*
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
* The default is 5. This number cannot be set to 0.
+1 -1
View File
@@ -503,7 +503,7 @@ command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomn
*
* Used to NOOP a server, which prevents users from opering on that server.
*/
module { name = "os_noop" }
#module { name = "os_noop" }
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop"; }
/*
+26
View File
@@ -1,3 +1,29 @@
Anope Version 2.1.6
-------------------
Added opportunistic upgrading of TLS fingerprints to more secure algorithms on InspIRCd.
Added support for logging out partially connected users on Plexus.
Added the account registration time to nickserv/info.
Changed ns_cert to automatically add a TLS fingerprint to new accounts if available.
Clarified that a non-deprecated encryption module must be loaded.
Fixed creating the runtime directory on Windows.
Fixed mistakenly allowing badpasslimit to be set to a negative value.
Fixed parsing backup TLS fingerprints on InspIRCd.
Fixed parsing the flood mode on UnrealIRCd.
Fixed parsing the history mode on UnrealIRCd.
Fixed various iterator invalidation issues.
Partially rewrote the Portuguese translation.
Removed some incorrect strings from the Turkish translation.
Renamed the --modulesdir option to --moduledir to match the name of other path options.
Anope Version 2.1.5
-------------------
Added an example systemd unit file.
Added support for BIGLINES on UnrealIRCd.
Bumped the minimum supported version of Bahamut to 2.0.
Fixed truncating messages in global/global and global/server.
Improved building Anope for use as a system package.
Updated the Turkish translation.
Anope Version 2.1.4
-------------------
Added a check for a non-deprecated encryption module on start.
+10
View File
@@ -1,3 +1,13 @@
Anope Version 2.1.6
-------------------
Added module:automatic to the ns_cert module (defaults to yes).
Removed module:use_server_side_mlock for the protocol modules (now always enabled).
Removed module:use_server_side_topiclock for the protocol modules (now always enabled).
Anope Version 2.1.5
-------------------
Added the nickserv/drop/override and chanserv/drop/override oper privileges.
Anope Version 2.1.4
-------------------
Added the db_atheme module.
+1 -1
View File
@@ -166,7 +166,7 @@ Table of Contents
Anope currently works with:
* Bahamut 1.4.27 or later (including 1.8)
* Bahamut 2.0 or later
* ircd-hybrid 8.2.23 or later
* InspIRCd 3 or later
* ngIRCd 19.2 or later
+2
View File
@@ -130,6 +130,8 @@ public:
Anope::string language;
/* Last time an email was sent to this user */
time_t lastmail = 0;
/* The time this account was registered */
time_t time_registered = Anope::CurTime;
MemoInfo memos;
std::map<Anope::string, Anope::string> last_modes;
-7
View File
@@ -717,9 +717,6 @@ protected:
*/
Anope::string source;
public:
/** Default constructor, just uses the error message 'Core threw an exception'.
*/
CoreException() : err("Core threw an exception"), source("The core") { }
/** This constructor can be used to specify an error message before throwing.
*/
CoreException(const Anope::string &message) : err(message), source("The core") { }
@@ -750,10 +747,6 @@ class CoreExport ModuleException
: public CoreException
{
public:
/** Default constructor, just uses the error message 'Module threw an exception'.
*/
ModuleException() : CoreException("Module threw an exception", "A Module") { }
/** This constructor can be used to specify an error message before throwing.
*/
ModuleException(const Anope::string &message) : CoreException(message, "A Module") { }
+1
View File
@@ -194,6 +194,7 @@ public:
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
{
data.SetType(this->name, Serialize::Data::DT_INT);
data[this->name] << true;
}
+2
View File
@@ -199,6 +199,8 @@ public:
class CoreExport NotImplementedException final
: public CoreException
{
public:
NotImplementedException() : CoreException("") { }
};
/** Every module in Anope is actually a class.
+1
View File
@@ -79,4 +79,5 @@ public:
CertService(Module *c) : Service(c, "CertService", "certs") { }
virtual NickCore *FindAccountFromCert(const Anope::string &cert) = 0;
virtual void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) = 0;
};
+4 -4
View File
@@ -74,6 +74,9 @@ public:
/* Can we force join or part users? */
bool CanSVSJoin = false;
/** Can we force servers to remove opers? */
bool CanSVSNOOP = false;
/* Can we set vhosts on users? */
bool CanSetVHost = false;
@@ -98,9 +101,6 @@ public:
/* See ns_cert */
bool CanCertFP = false;
/* Can users log out before being fully connected? */
bool CanSVSLogout = false;
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
bool RequiresID = false;
@@ -299,7 +299,7 @@ public:
/** Send a channel creation message to the uplink.
* On most TS6 IRCds this is a SJOIN with no nick
*/
virtual void SendChannel(Channel *c) { }
virtual void SendChannel(Channel *c) = 0;
/** Make the user an IRC operator
* Normally this is a simple +o, though some IRCds require us to send the oper type
+15
View File
@@ -20,6 +20,21 @@
// Whether Anope was built in debug mode.
#cmakedefine01 DEBUG_BUILD
// The default config directory.
#define DEFAULT_CONF_DIR "@CONF_DIR@"
// The default data directory.
#define DEFAULT_DATA_DIR "@DATA_DIR@"
// The default locale directory.
#define DEFAULT_LOCALE_DIR "@LOCALE_DIR@"
// The default log directory.
#define DEFAULT_LOG_DIR "@LOG_DIR@"
// The default module directory.
#define DEFAULT_MODULE_DIR "@MODULE_DIR@"
// Whether the clock_gettime() function is available.
#cmakedefine01 HAVE_CLOCK_GETTIME
+1 -1
View File
@@ -42,7 +42,7 @@ static std::string get_git_hash(const std::string &git_dir)
}
fd.close();
return "g" + filebuf.substr(0, 7);
return filebuf.substr(0, 7);
}
static bool read_version_sh(const std::string &version_sh, std::map<std::string, std::string> &versions)
+23 -3
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Anope\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-15 12:41+0000\n"
"PO-Revision-Date: 2024-03-15 12:41+0000\n"
"POT-Creation-Date: 2024-05-11 17:38+0100\n"
"PO-Revision-Date: 2024-05-11 17:39+0100\n"
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
"Language-Team: English\n"
"Language: en_US\n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4\n"
"X-Generator: Poedit 3.4.2\n"
#, c-format
msgid "%d channel(s) cleared, and %d channel(s) dropped."
@@ -1812,6 +1812,9 @@ msgstr "Account"
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
msgid "Account registered"
msgstr "Account registered"
msgid "Accounts can not be registered right now. Please try again later."
msgstr "Accounts can not be registered right now. Please try again later."
@@ -1875,6 +1878,13 @@ msgstr ""
"Adding, deleting, or clearing entry messages requires the\n"
"SET permission."
msgid ""
"Additionally, Services Operators with the chanserv/drop/override permission can\n"
"replace code with OVERRIDE to drop without a confirmation code."
msgstr ""
"Additionally, Services Operators with the chanserv/drop/override permission can\n"
"replace code with OVERRIDE to drop without a confirmation code."
msgid ""
"Additionally, Services Operators with the nickserv/confirm permission can\n"
"replace passcode with a users nick to force validate them."
@@ -1882,6 +1892,13 @@ msgstr ""
"Additionally, Services Operators with the nickserv/confirm permission can\n"
"replace passcode with a users nick to force validate them."
msgid ""
"Additionally, Services Operators with the nickserv/drop/override permission can\n"
"replace code with OVERRIDE to drop without a confirmation code."
msgstr ""
"Additionally, Services Operators with the nickserv/drop/override permission can\n"
"replace code with OVERRIDE to drop without a confirmation code."
#, c-format
msgid ""
"Additionally, if fantasy is enabled fantasy commands\n"
@@ -5127,6 +5144,9 @@ msgstr "Nick %s is now released."
msgid "Nick %s is now suspended."
msgstr "Nick %s is now suspended."
msgid "Nick registered"
msgstr "Nick registered"
#, c-format
msgid "Nick too long, max length is %zu characters."
msgstr "Nick too long, max length is %zu characters."
+2350 -4599
View File
File diff suppressed because it is too large Load Diff
+230 -364
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -94,7 +94,9 @@ macro(build_modules SRC)
target_link_libraries(${SO} ${PROGRAM_NAME})
endif()
# Set the module to be installed to the module directory under the data directory
install(TARGETS ${SO} DESTINATION ${LIB_DIR}/modules)
install(TARGETS ${SO}
DESTINATION ${MODULE_DIR}
LIBRARY)
endif()
endif()
endforeach()
@@ -168,7 +170,9 @@ macro(build_subdir)
endif()
# Set the module to be installed to the module directory under the data directory
install(TARGETS ${SO} DESTINATION ${LIB_DIR}/modules)
install(TARGETS ${SO}
DESTINATION ${MODULE_DIR}
LIBRARY)
endmacro()
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+10 -11
View File
@@ -53,17 +53,16 @@ struct KickerDataImpl final
if (kd == NULL)
return;
data["kickerdata:amsgs"] << kd->amsgs;
data["kickerdata:badwords"] << kd->badwords;
data["kickerdata:bolds"] << kd->bolds;
data["kickerdata:caps"] << kd->caps;
data["kickerdata:colors"] << kd->colors;
data["kickerdata:flood"] << kd->flood;
data["kickerdata:italics"] << kd->italics;
data["kickerdata:repeat"] << kd->repeat;
data["kickerdata:reverses"] << kd->reverses;
data["kickerdata:underlines"] << kd->underlines;
data.SetType("kickerdata:amsgs", Serialize::Data::DT_INT); data["kickerdata:amsgs"] << kd->amsgs;
data.SetType("kickerdata:badwords", Serialize::Data::DT_INT); data["kickerdata:badwords"] << kd->badwords;
data.SetType("kickerdata:bolds", Serialize::Data::DT_INT); data["kickerdata:bolds"] << kd->bolds;
data.SetType("kickerdata:caps", Serialize::Data::DT_INT); data["kickerdata:caps"] << kd->caps;
data.SetType("kickerdata:colors", Serialize::Data::DT_INT); data["kickerdata:colors"] << kd->colors;
data.SetType("kickerdata:flood", Serialize::Data::DT_INT); data["kickerdata:flood"] << kd->flood;
data.SetType("kickerdata:italics", Serialize::Data::DT_INT); data["kickerdata:italics"] << kd->italics;
data.SetType("kickerdata:repeat", Serialize::Data::DT_INT); data["kickerdata:repeat"] << kd->repeat;
data.SetType("kickerdata:reverses", Serialize::Data::DT_INT); data["kickerdata:reverses"] << kd->reverses;
data.SetType("kickerdata:underlines", Serialize::Data::DT_INT); data["kickerdata:underlines"] << kd->underlines;
data.SetType("capsmin", Serialize::Data::DT_INT); data["capsmin"] << kd->capsmin;
data.SetType("capspercent", Serialize::Data::DT_INT); data["capspercent"] << kd->capspercent;
data.SetType("floodlines", Serialize::Data::DT_INT); data["floodlines"] << kd->floodlines;
+5 -1
View File
@@ -50,7 +50,7 @@ public:
}
auto *code = dropcode.Get(ci);
if (params.size() < 2 || !code || !code->equals_ci(params[1]))
if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("chanserv/drop/override") || params[1] != "OVERRIDE")))
{
if (!code)
{
@@ -94,6 +94,10 @@ public:
source.Reply(_("Unregisters the named channel. Can only be used by\n"
"the \002channel founder\002."));
source.Reply(" ");
if (source.HasPriv("chanserv/drop/override"))
source.Reply(_("Additionally, Services Operators with the \037chanserv/drop/override\037 permission can\n"
"replace \037code\037 with \002OVERRIDE\002 to drop without a confirmation code."));
return true;
}
};
+2 -1
View File
@@ -658,7 +658,8 @@ class CommandCSMode final
}
else
{
for (const auto &mode : ci->c->GetModeList(cm->name))
std::vector<Anope::string> v = ci->c->GetModeList(cm->name);
for (const auto &mode : v)
{
if (Anope::Match(mode, param))
ci->c->RemoveMode(NULL, cm, mode);
+1 -1
View File
@@ -1146,7 +1146,7 @@ public:
if (c->ci && keep_modes.HasExt(c->ci))
{
Channel::ModeList ml = c->ci->last_modes;
for (const auto &[last_mode, last_value] : c->ci->last_modes)
for (const auto &[last_mode, last_value] : ml)
c->SetMode(c->ci->WhoSends(), last_mode, last_value);
}
}
+2 -1
View File
@@ -1131,7 +1131,7 @@ private:
auto display = row.Get();
auto pass = row.Get();
auto email = row.Get();
/* auto regtime = */ row.GetNum<time_t>();
auto regtime = row.GetNum<time_t>();
/* auto lastlogin = */ row.Get();
auto flags = row.Get();
auto language = row.Get();
@@ -1141,6 +1141,7 @@ private:
auto *nc = new NickCore(display);
nc->email = email;
nc->time_registered = regtime;
ApplyPassword(nc, flags, pass);
// No equivalent: bglmNQrS
+2
View File
@@ -311,6 +311,8 @@ public:
for (auto *base : items)
{
Serialize::Type *s_type = base->GetSerializableType();
if (!s_type)
continue;
data.fs = databases[s_type->GetOwner()];
if (!data.fs || !data.fs->is_open())
+10 -5
View File
@@ -354,9 +354,14 @@ Result MySQLService::RunQuery(const Query &query)
{
this->Lock.lock();
Anope::string real_query = this->BuildQuery(query);
if (!this->CheckConnection())
{
this->Lock.unlock();
return MySQLResult(query, query.query, mysql_error(this->sql));
}
if (this->CheckConnection() && !mysql_real_query(this->sql, real_query.c_str(), real_query.length()))
Anope::string real_query = this->BuildQuery(query);
if (!mysql_real_query(this->sql, real_query.c_str(), real_query.length()))
{
MYSQL_RES *res = mysql_store_result(this->sql);
unsigned int id = mysql_insert_id(this->sql);
@@ -410,11 +415,11 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
query_text += ", `" + column + "` ";
if (data.GetType(column) == Serialize::Data::DT_INT)
query_text += "int(11)";
query_text += "int";
else
query_text += "text";
}
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`))";
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC";
queries.push_back(query_text);
}
else
@@ -428,7 +433,7 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` ";
if (data.GetType(column) == Serialize::Data::DT_INT)
query_text += "int(11)";
query_text += "int";
else
query_text += "text";
+1 -1
View File
@@ -29,7 +29,7 @@ private:
public:
CommandGLGlobal(Module *creator)
: Command(creator, "global/global", 0)
: Command(creator, "global/global", 0, 1)
, global("GlobalService", "Global")
{
this->SetDesc(_("Send a message to all users"));
+1 -1
View File
@@ -29,7 +29,7 @@ private:
public:
CommandGLServer(Module *creator)
: Command(creator, "global/server", 1)
: Command(creator, "global/server", 1, 2)
, global("GlobalService", "Global")
{
this->SetDesc(_("Send a message to all users on a server"));
+28
View File
@@ -26,6 +26,17 @@ struct CertServiceImpl final
return it->second;
return NULL;
}
void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) override
{
auto *nc = FindAccountFromCert(oldcert);
if (!nc)
return;
auto *cl = nc->GetExt<NSCertList>("certificates");
if (cl)
cl->ReplaceCert(oldcert, newcert);
}
};
struct NSCertListImpl final
@@ -111,6 +122,14 @@ public:
FOREACH_MOD(OnNickEraseCert, (this->nc, oldentry));
certmap.erase(oldentry);
if (std::find(this->certs.begin(), this->certs.end(), newentry) != this->certs.end())
{
// The cert we're upgrading to already exists.
this->certs.erase(it);
return;
}
*it = newentry;
certmap[newentry] = nc;
FOREACH_MOD(OnNickAddCert, (this->nc, newentry));
@@ -397,6 +416,15 @@ public:
Log(NickServ) << u->GetMask() << " automatically identified for account " << nc->display << " via SSL certificate fingerprint";
}
void OnNickRegister(User *u, NickAlias *na, const Anope::string &pass) override
{
if (!Config->GetModule(this)->Get<bool>("automatic", "yes") || u->fingerprint.empty())
return;
auto *cl = certs.Require(na->nc);
cl->AddCert(u->fingerprint);
}
EventReturn OnNickValidate(User *u, NickAlias *na) override
{
NSCertList *cl = certs.Get(na->nc);
+7 -1
View File
@@ -58,7 +58,7 @@ public:
}
auto *code = dropcode.Get(na);
if (params.size() < 2 || !code || !code->equals_ci(params[1]))
if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("nickserv/drop/override") || params[1] != "OVERRIDE")))
{
if (!code)
{
@@ -87,11 +87,17 @@ public:
"is dropped you may lose all of your access and channels that\n"
"you may own. Any other user will be able to gain control of\n"
"this nick."));
source.Reply(" ");
if (!source.HasPriv("nickserv/drop"))
source.Reply(_("You may drop any nick within your group."));
else
source.Reply(_("As a Services Operator, you may drop any nick."));
source.Reply(" ");
if (source.HasPriv("nickserv/drop/override"))
source.Reply(_("Additionally, Services Operators with the \037nickserv/drop/override\037 permission can\n"
"replace \037code\037 with \002OVERRIDE\002 to drop without a confirmation code."));
return true;
}
};
+2 -1
View File
@@ -88,7 +88,8 @@ public:
info[_("Last seen address")] = na->last_realhost;
}
info[_("Registered")] = Anope::strftime(na->time_registered, source.GetAccount());
info[_("Account registered")] = Anope::strftime(na->nc->time_registered, source.GetAccount());
info[_("Nick registered")] = Anope::strftime(na->time_registered, source.GetAccount());
if (!nick_online)
info[_("Last seen")] = Anope::strftime(na->last_seen, source.GetAccount());
+2 -1
View File
@@ -1354,7 +1354,8 @@ public:
{
if (keep_modes.HasExt(u->Account()))
{
for (const auto &[last_mode, last_value] : u->Account()->last_modes)
User::ModeList modes = u->Account()->last_modes;
for (const auto &[last_mode, last_value] : modes)
{
UserMode *um = ModeManager::FindUserModeByName(last_mode);
/* if the null user can set the mode, then it's probably safe */
+2 -1
View File
@@ -82,7 +82,8 @@ public:
OSNOOP(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
commandosnoop(this), noop(this, "noop")
{
if (!IRCD || !IRCD->CanSVSNOOP)
throw ModuleException("Your IRCd does not support SVSNOOP.");
}
void OnUserModeSet(const MessageSource &, User *u, const Anope::string &mname) override
+8 -23
View File
@@ -35,10 +35,11 @@ class BahamutIRCdProto final
: public IRCDProto
{
public:
BahamutIRCdProto(Module *creator) : IRCDProto(creator, "Bahamut 1.8.x")
BahamutIRCdProto(Module *creator) : IRCDProto(creator, "Bahamut 2+")
{
DefaultPseudoclientModes = "+";
CanSVSNick = true;
CanSVSNOOP = true;
CanSNLine = true;
CanSQLine = true;
CanSQLineChannel = true;
@@ -49,14 +50,9 @@ public:
void SendModeInternal(const MessageSource &source, Channel *chan, const Anope::string &modes, const std::vector<Anope::string> &values) override
{
if (Servers::Capab.count("TSMODE") > 0)
{
auto params = values;
params.insert(params.begin(), { chan->name, Anope::ToString(chan->creation_time), modes });
Uplink::SendInternal({}, source, "MODE", params);
}
else
IRCDProto::SendModeInternal(source, chan, modes, values);
auto params = values;
params.insert(params.begin(), { chan->name, Anope::ToString(chan->creation_time), modes });
Uplink::SendInternal({}, source, "MODE", params);
}
void SendModeInternal(const MessageSource &source, User *u, const Anope::string &modes, const std::vector<Anope::string> &values) override
@@ -103,10 +99,6 @@ public:
/* UNSZLINE */
void SendSZLineDel(const XLine *x) override
{
/* this will likely fail so its only here for legacy */
Uplink::Send("UNSZLINE", 0, x->GetHost());
/* this is how we are supposed to deal with it */
Uplink::Send("RAKILL", x->GetHost(), '*');
}
@@ -115,11 +107,6 @@ public:
{
// Calculate the time left before this would expire
time_t timeleft = x->expires ? x->expires - Anope::CurTime : x->expires;
/* this will likely fail so its only here for legacy */
Uplink::Send("SZLINE", x->GetHost(), x->GetReason());
/* this is how we are supposed to deal with it */
Uplink::Send("AKILL", x->GetHost(), '*', timeleft, x->by, Anope::CurTime, x->GetReason());
}
@@ -252,7 +239,7 @@ public:
void SendClientIntroduction(User *u) override
{
Uplink::Send("NICK", u->nick, 1, u->timestamp, "+" + u->GetModes(), u->GetIdent(), u->host, u->server->GetName(), 0, 0, u->realname);
Uplink::Send("NICK", u->nick, 1, u->timestamp, "+" + u->GetModes(), u->GetIdent(), u->host, u->server->GetName(), 0, "0.0.0.0", u->realname);
}
/* SERVER */
@@ -264,7 +251,7 @@ public:
void SendConnect() override
{
Uplink::Send("PASS", Config->Uplinks[Anope::CurrentUplink].password, "TS");
Uplink::Send("CAPAB", "SSJOIN", "NOQUIT", "BURST", "UNCONNECT", "NICKIP", "TSMODE", "TS3");
Uplink::Send("CAPAB", "BURST", "NICKIPSTR", "SSJOIN", "UNCONNECT");
SendServer(Me);
/*
* SVINFO
@@ -274,7 +261,7 @@ public:
* parv[3] = server is standalone or connected to non-TS only
* parv[4] = server's idea of UTC time
*/
Uplink::Send("SVINFO", 3, 1, 0, Anope::CurTime);
Uplink::Send("SVINFO", 5, 5, 0, Anope::CurTime);
this->SendBOB();
}
@@ -557,9 +544,7 @@ public:
message_burst(this), message_mode(this, "MODE"), message_svsmode(this, "SVSMODE"),
message_nick(this), message_server(this), message_sjoin(this), message_topic(this)
{
this->AddModes();
}
void OnUserNickChange(User *u, const Anope::string &) override
+4 -11
View File
@@ -711,8 +711,6 @@ class ProtoHybrid final
IRCDMessageTMode message_tmode;
IRCDMessageUID message_uid;
bool use_server_side_mlock;
static void AddModes()
{
/* Add user modes */
@@ -819,18 +817,13 @@ public:
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
}
void OnReload(Configuration::Conf *conf) override
{
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
}
void OnChannelSync(Channel *c) override
{
if (!c->ci)
return;
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
if (use_server_side_mlock && modelocks && Servers::Capab.count("MLOCK"))
if (modelocks && Servers::Capab.count("MLOCK"))
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
Uplink::Send("MLOCK", c->creation_time, c->ci->name, Anope::CurTime, modes);
@@ -839,7 +832,7 @@ public:
void OnDelChan(ChannelInfo *ci) override
{
if (use_server_side_mlock && ci->c && Servers::Capab.count("MLOCK"))
if (ci->c && Servers::Capab.count("MLOCK"))
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, "");
}
@@ -847,7 +840,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, modes);
@@ -860,7 +853,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, modes);
+52 -44
View File
@@ -10,9 +10,10 @@
*/
#include "module.h"
#include "modules/encryption.h"
#include "modules/cs_mode.h"
#include "modules/encryption.h"
#include "modules/httpd.h"
#include "modules/ns_cert.h"
#include "modules/sasl.h"
typedef std::map<char, unsigned> ListLimits;
@@ -144,7 +145,6 @@ public:
CanSetVIdent = true;
CanSQLine = true;
CanSZLine = true;
CanSVSLogout = true;
CanCertFP = true;
RequiresID = true;
MaxModes = 0;
@@ -1592,7 +1592,10 @@ struct IRCDMessageCapab final
if (!Servers::Capab.count("GLOBOPS"))
Log() << "The remote server does not have the globops module; oper notices will be sent as announcements until the module is loaded.";
Uplink::Send("SERVER", Me->GetName(), GetPassword(), 0, Me->GetSID(), Me->GetDescription());
if (spanningtree_proto_ver < 1206)
Uplink::Send("SERVER", Me->GetName(), GetPassword(), 0, Me->GetSID(), Me->GetDescription());
else
Uplink::Send("SERVER", Me->GetName(), GetPassword(), Me->GetSID(), Me->GetDescription());
}
}
};
@@ -1802,12 +1805,20 @@ struct IRCDMessageSave final
class IRCDMessageMetadata final
: IRCDMessage
{
const bool &do_topiclock;
const bool &do_mlock;
private:
ServiceReference<CertService> certs;
PrimitiveExtensibleItem<ListLimits> &maxlist;
public:
IRCDMessageMetadata(Module *creator, const bool &handle_topiclock, const bool &handle_mlock, PrimitiveExtensibleItem<ListLimits> &listlimits) : IRCDMessage(creator, "METADATA", 3), do_topiclock(handle_topiclock), do_mlock(handle_mlock), maxlist(listlimits) { SetFlag(FLAG_REQUIRE_SERVER); SetFlag(FLAG_SOFT_LIMIT); }
IRCDMessageMetadata(Module *creator, PrimitiveExtensibleItem<ListLimits> &listlimits)
: IRCDMessage(creator, "METADATA", 3)
, certs("CertService", "certs")
, maxlist(listlimits)
{
SetFlag(FLAG_REQUIRE_SERVER);
SetFlag(FLAG_SOFT_LIMIT);
}
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override
{
@@ -1819,7 +1830,7 @@ public:
Channel *c = Channel::Find(params[0]);
if (c)
{
if ((c->ci) && (do_mlock) && (params[2] == "mlock"))
if (c->ci && params[2] == "mlock")
{
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
Anope::string modes;
@@ -1830,7 +1841,7 @@ public:
if (modes != params[3])
Uplink::Send("METADATA", c->name, c->creation_time, "mlock", modes);
}
else if ((c->ci) && (do_topiclock) && (params[2] == "topiclock"))
else if (c->ci && params[2] == "topiclock")
{
bool mystate = c->ci->HasExt("TOPICLOCK");
bool serverstate = (params[3] == "1");
@@ -1852,12 +1863,12 @@ public:
}
else if (isdigit(params[0][0]))
{
auto *u = User::Find(params[0]);
if (!u)
return;
if (params[1].equals_cs("accountname"))
{
User *u = User::Find(params[0]);
if (!u)
return; // Should never happen.
if (params[2].empty())
{
// The user has been logged out by the IRC server.
@@ -1880,18 +1891,22 @@ public:
*/
else if (params[1].equals_cs("ssl_cert"))
{
User *u = User::Find(params[0]);
if (!u)
return;
u->Extend<bool>("ssl");
Anope::string data = params[2].c_str();
size_t pos1 = data.find(' ') + 1;
size_t pos2 = data.find(' ', pos1);
if ((pos2 - pos1) >= 32) // inspircd supports md5 and sha1 fingerprint hashes -> size 32 or 40 bytes.
{
u->fingerprint = data.substr(pos1, pos2 - pos1);
}
Anope::string data;
spacesepstream tokens(params[2]);
if (!tokens.GetToken(data) || data.find('E') != Anope::string::npos || !tokens.GetToken(data))
return; // Malformed or no client certificate.
commasepstream fingerprints(data);
if (!fingerprints.GetToken(data))
return; // Should never happen?
u->fingerprint = data;
FOREACH_MOD(OnFingerprint, (u));
while (certs && fingerprints.GetToken(data))
certs->ReplaceCert(data, u->fingerprint);
}
}
else if (params[0] == "*")
@@ -2285,18 +2300,18 @@ struct IRCDMessageServer final
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override
{
if (!source.GetServer() && params.size() == 5)
size_t paramcount = spanningtree_proto_ver < 1206 ? 5 : 4;
if (!source.GetServer() && params.size() == paramcount)
{
/*
* SERVER testnet.inspircd.org hunter7 0 123 :InspIRCd Test Network
* 0: name
* 1: pass
* 2: hops
* 3: numeric
* 4: desc
* 2: unused (v3 only)
* 3(2): numeric
* 4(3): desc
*/
auto hops = Anope::Convert<unsigned>(params[2], 0);
new Server(Me, params[0], hops, params[4], params[3]);
new Server(Me, params[0], 0, params.back(), params[spanningtree_proto_ver < 1206 ? 3 : 2]);
}
else if (source.GetServer())
{
@@ -2434,8 +2449,6 @@ class ProtoInspIRCd final
IRCDMessageSQuit message_squit;
IRCDMessageUID message_uid;
bool use_server_side_topiclock, use_server_side_mlock;
static void SendChannelMetadata(Channel *c, const Anope::string &metadataname, const Anope::string &value)
{
Uplink::Send("METADATA", c->name, c->creation_time, metadataname, value);
@@ -2472,7 +2485,7 @@ public:
, message_ijoin(this)
, message_kick(this)
, message_lmode(this)
, message_metadata(this, use_server_side_topiclock, use_server_side_mlock, ircd_proto.maxlist)
, message_metadata(this, ircd_proto.maxlist)
, message_mode(this)
, message_nick(this)
, message_opertype(this)
@@ -2486,12 +2499,6 @@ public:
{
}
void OnReload(Configuration::Conf *conf) override
{
use_server_side_topiclock = conf->GetModule(this)->Get<bool>("use_server_side_topiclock");
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
}
void OnUserNickChange(User *u, const Anope::string &) override
{
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
@@ -2506,13 +2513,13 @@ public:
void OnChanRegistered(ChannelInfo *ci) override
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
if (use_server_side_mlock && ci->c && modelocks && !modelocks->GetMLockAsString(false).empty())
if (ci->c && modelocks && !modelocks->GetMLockAsString(false).empty())
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
SendChannelMetadata(ci->c, "mlock", modes);
}
if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
if (Servers::Capab.count("TOPICLOCK") && ci->c)
{
if (ci->HasExt("TOPICLOCK"))
SendChannelMetadata(ci->c, "topiclock", "1");
@@ -2521,10 +2528,11 @@ public:
void OnDelChan(ChannelInfo *ci) override
{
if (use_server_side_mlock && ci->c)
SendChannelMetadata(ci->c, "mlock", "");
if (!ci->c)
return;
if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
SendChannelMetadata(ci->c, "mlock", "");
if (Servers::Capab.count("TOPICLOCK"))
SendChannelMetadata(ci->c, "topiclock", "");
}
@@ -2532,7 +2540,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
SendChannelMetadata(ci->c, "mlock", modes);
@@ -2545,7 +2553,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
SendChannelMetadata(ci->c, "mlock", modes);
+10 -1
View File
@@ -25,6 +25,7 @@ public:
DefaultPseudoclientModes = "+iU";
CanSVSNick = true;
CanSVSJoin = true;
CanSVSNOOP = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSNLine = true;
@@ -186,7 +187,15 @@ public:
void SendSVSLogin(const Anope::string &uid, NickAlias *na) override
{
Server *s = Server::Find(uid.substr(0, 3));
Uplink::Send("ENCAP", s ? s->GetName() : uid.substr(0, 3), "SVSLOGIN", uid, '*', '*', na->GetVHostHost().empty() ? "*" : na->GetVHostHost(), na->nc->display);
Anope::string target = s ? s->GetName() : uid.substr(0, 3);
if (na)
{
Uplink::Send("ENCAP", target, "SVSLOGIN", uid, '*', '*', na->GetVHostHost().empty() ? "*" : na->GetVHostHost(), na->nc->display);
}
else
{
Uplink::Send("ENCAP", target, "SU", uid, "");
}
}
void SendSVSNOOP(const Server *server, bool set) override
+3 -11
View File
@@ -45,7 +45,6 @@ public:
CanSZLine = true;
CanSVSNick = true;
CanSVSHold = true;
CanSVSLogout = true;
CanSetVHost = true;
RequiresID = true;
MaxModes = 4;
@@ -355,8 +354,6 @@ class ProtoSolanum final
IRCDMessagePrivmsg message_privmsg;
IRCDMessageServer message_server;
bool use_server_side_mlock;
static void AddModes()
{
/* Add user modes */
@@ -445,18 +442,13 @@ public:
OnUserLogin(u);
}
void OnReload(Configuration::Conf *conf) override
{
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
}
void OnChannelSync(Channel *c) override
{
if (!c->ci)
return;
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
if (use_server_side_mlock && modelocks && Servers::Capab.count("MLOCK") > 0)
if (modelocks && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
Uplink::Send("MLOCK", c->creation_time, c->ci->name, modes);
@@ -467,7 +459,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
@@ -480,7 +472,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
+14 -26
View File
@@ -28,6 +28,7 @@ public:
DefaultPseudoclientModes = "+BioqS";
CanSVSNick = true;
CanSVSJoin = true;
CanSVSNOOP = true;
CanSetVHost = true;
CanSetVIdent = true;
CanSNLine = true;
@@ -36,7 +37,6 @@ public:
CanSZLine = true;
CanSVSHold = true;
CanClearBans = true;
CanSVSLogout = true;
CanCertFP = true;
RequiresID = true;
MaxModes = 12;
@@ -229,7 +229,7 @@ private:
*/
Uplink::Send("PASS", Config->Uplinks[Anope::CurrentUplink].password);
Uplink::Send("PROTOCTL", "NICKv2", "VHP", "UMODE2", "NICKIP", "SJOIN", "SJOIN2", "SJ3", "NOQUIT", "TKLEXT", "MLOCK", "SID", "MTAGS");
Uplink::Send("PROTOCTL", "NICKv2", "VHP", "UMODE2", "NICKIP", "SJOIN", "SJOIN2", "SJ3", "NOQUIT", "TKLEXT", "MLOCK", "SID", "MTAGS", "BIGLINES");
Uplink::Send("PROTOCTL", "EAUTH=" + Me->GetName() + ",,,Anope-" + Anope::VersionShort());
Uplink::Send("PROTOCTL", "SID=" + Me->GetSID());
@@ -675,24 +675,18 @@ public:
/* Borrowed part of this check from UnrealIRCd */
bool IsValid(Anope::string &value) const override
{
if (value.empty() || value[0] == ':')
if (value.empty() || value[0] != '[')
return false;
Anope::string rest;
auto num1 = Anope::Convert<unsigned>(value[0] == '*' ? value.substr(1) : value, 0, &rest);
if (!num1 || rest[0] != ':' || rest.length() <= 1)
return false;
if (Anope::Convert<int>(rest.substr(1), 0, &rest) > 0 && rest.empty())
return true;
/* '['<number><1 letter>[optional: '#'+1 letter],[next..]']'':'<number> */
size_t end_bracket = value.find(']', 1);
if (end_bracket == Anope::string::npos)
return false;
Anope::string xbuf = value.substr(0, end_bracket);
if (value[end_bracket + 1] != ':')
return false;
commasepstream args(xbuf.substr(1));
Anope::string arg;
while (args.GetToken(arg))
@@ -735,8 +729,7 @@ public:
// The part after the ':' is a duration and it
// can be in the user friendly "1d3h20m" format, make sure we accept that
auto n = Anope::DoTime(rest.substr(1));
return n <= 0;
return false;
return n > 0;
}
};
@@ -1032,6 +1025,8 @@ struct IRCDMessageCapab final
ModeManager::AddChannelMode(new ChannelModeStatus(mode_name, mode_chars[t], mode_prefixes[t], t));
}
}
else if (capab.equals_ci("BIGLINES"))
IRCD->MaxLine = 16384;
}
Message::Capab::Run(source, params, tags);
@@ -1159,7 +1154,7 @@ struct IRCDMessageMode final
if (IRCD->IsChannelValid(params[0]))
{
Channel *c = Channel::Find(params[0]);
auto ts = IRCD->ExtractTimestamp(params.back());
auto ts = server_source ? IRCD->ExtractTimestamp(params.back()) : 0;
if (c)
c->SetModesInternal(source, modes, ts);
@@ -1693,8 +1688,6 @@ class ProtoUnreal final
IRCDMessageUID message_uid;
IRCDMessageUmode2 message_umode2;
bool use_server_side_mlock;
public:
ProtoUnreal(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
ircd_proto(this),
@@ -1717,11 +1710,6 @@ public:
ModuleManager::SetPriority(this, PRIORITY_FIRST);
}
void OnReload(Configuration::Conf *conf) override
{
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
}
void OnUserNickChange(User *u, const Anope::string &) override
{
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
@@ -1735,7 +1723,7 @@ public:
return;
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
if (use_server_side_mlock && Servers::Capab.count("MLOCK") > 0 && modelocks)
if (Servers::Capab.count("MLOCK") > 0 && modelocks)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
Uplink::Send("MLOCK", c->creation_time, c->ci->name, modes);
@@ -1745,7 +1733,7 @@ public:
void OnChanRegistered(ChannelInfo *ci) override
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
if (!ci->c || !use_server_side_mlock || !modelocks || !Servers::Capab.count("MLOCK"))
if (!ci->c || !modelocks || !Servers::Capab.count("MLOCK"))
return;
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
@@ -1753,7 +1741,7 @@ public:
void OnDelChan(ChannelInfo *ci) override
{
if (!ci->c || !use_server_side_mlock || !Servers::Capab.count("MLOCK"))
if (!ci->c || !Servers::Capab.count("MLOCK"))
return;
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, "");
}
@@ -1762,7 +1750,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
@@ -1775,7 +1763,7 @@ public:
{
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
{
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
+1 -1
View File
@@ -237,7 +237,7 @@ public:
void StartTransaction() override
{
if (in_transaction)
throw CoreException();
throw ModuleException("Tried to start a transaction while one was already in progress");
this->SendCommand(NULL, "MULTI");
in_transaction = true;
-8
View File
@@ -145,14 +145,6 @@ public:
void ProcessMessage(Session *sess, const SASL::Message &m) override
{
if (!IRCD->CanSVSLogout && !User::Find(sess->uid))
{
// This IRCd can't log users out yet.
sasl->Fail(sess);
delete sess;
return;
}
if (m.type == "S")
{
sasl->SendMessage(sess, "C", "+");
+1 -1
View File
@@ -1,5 +1,5 @@
build_subdir(${CMAKE_CURRENT_SOURCE_DIR})
install(DIRECTORY "templates/"
DESTINATION "${DB_DIR}/webcpanel/templates/default"
DESTINATION "${DATA_DIR}/webcpanel/templates/default"
)
+1 -1
View File
@@ -103,7 +103,7 @@ bool WebCPanel::NickServ::Info::OnRequest(HTTPProvider *server, const Anope::str
replacements["DISPLAY"] = na->nc->display;
if (!na->nc->email.empty())
replacements["EMAIL"] = na->nc->email;
replacements["TIME_REGISTERED"] = Anope::strftime(na->time_registered, na->nc);
replacements["TIME_REGISTERED"] = Anope::strftime(na->nc->time_registered, na->nc);
if (na->HasVHost())
replacements["VHOST"] = na->GetVHostMask();
Anope::string *greet = na->nc->GetExt<Anope::string>("greet");
+1
View File
@@ -95,4 +95,5 @@ endif()
# Set Anope to be installed to the bin directory
install(TARGETS ${PROGRAM_NAME}
DESTINATION ${BIN_DIR}
RUNTIME
)
+1
View File
@@ -26,6 +26,7 @@ CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core,
: nick(n)
, u(user)
, nc(core)
, ip(user ? user->ip.str() : "")
, reply(r)
, service(bi)
, msgid(m)
+1 -1
View File
@@ -190,7 +190,7 @@ Conf::Conf() : Block("")
if (mail->Get<bool>("usemail"))
{
Anope::string check[] = { "sendmailpath", "sendfrom", "registration_subject", "registration_message", "emailchange_subject", "emailchange_message", "memo_subject", "memo_message" };
Anope::string check[] = { "sendfrom", "registration_subject", "registration_message", "emailchange_subject", "emailchange_message", "memo_subject", "memo_message" };
for (const auto &field : check)
ValidateNotEmpty("mail", field, mail->Get<const Anope::string>(field));
}
+13 -7
View File
@@ -30,7 +30,11 @@
#endif
#include <thread>
Anope::string Anope::ConfigDir = "conf", Anope::DataDir = "data", Anope::ModuleDir = "lib", Anope::LocaleDir = "locale", Anope::LogDir = "logs";
Anope::string Anope::ConfigDir = DEFAULT_CONF_DIR;
Anope::string Anope::DataDir = DEFAULT_DATA_DIR;
Anope::string Anope::LocaleDir = DEFAULT_LOCALE_DIR;
Anope::string Anope::LogDir = DEFAULT_LOG_DIR;
Anope::string Anope::ModuleDir = DEFAULT_MODULE_DIR;
/* Vector of pairs of command line arguments and their params */
static std::vector<std::pair<Anope::string, Anope::string> > CommandLineArguments;
@@ -321,8 +325,8 @@ bool Anope::Init(int ac, char **av)
Log(LOG_TERMINAL) << "-d, --debug[=level]";
Log(LOG_TERMINAL) << "-h, --help";
Log(LOG_TERMINAL) << " --localedir=locale directory";
Log(LOG_TERMINAL) << " --logdir=logs directory";
Log(LOG_TERMINAL) << " --modulesdir=modules directory";
Log(LOG_TERMINAL) << " --logdir=log directory";
Log(LOG_TERMINAL) << " --moduledir=module directory";
Log(LOG_TERMINAL) << "-e, --noexpire";
Log(LOG_TERMINAL) << "-n, --nofork";
Log(LOG_TERMINAL) << "-p, --nopid";
@@ -405,10 +409,10 @@ bool Anope::Init(int ac, char **av)
Anope::LocaleDir = arg;
}
if (GetCommandLineArgument("modulesdir", 0, arg))
if (GetCommandLineArgument("moduledir", 0, arg))
{
if (arg.empty())
throw CoreException("The --modulesdir option requires a path");
throw CoreException("The --moduledir option requires a path");
Anope::ModuleDir = arg;
}
@@ -419,13 +423,15 @@ bool Anope::Init(int ac, char **av)
Anope::LogDir = arg;
}
Log(LOG_TERMINAL) << "Anope " << Anope::Version() << ", " << Anope::VersionBuildString();
/* Chdir to Anope data directory. */
Log() << "Moving to " << Anope::ServicesDir;
if (chdir(Anope::ServicesDir.c_str()) < 0)
{
throw CoreException("Unable to chdir to " + Anope::ServicesDir + ": " + Anope::LastError());
}
Log(LOG_TERMINAL) << "Anope " << Anope::Version() << ", " << Anope::VersionBuildString();
Log(LOG_TERMINAL) << "Using configuration file " << Anope::ExpandConfig(ServicesConf.GetName());
#ifndef _WIN32
@@ -530,7 +536,7 @@ bool Anope::Init(int ac, char **av)
auto *encryption = ModuleManager::FindFirstOf(ENCRYPTION);
if (!encryption)
throw CoreException("You must load an encryption module!");
throw CoreException("You must load a non-deprecated encryption module!");
auto *protocol = ModuleManager::FindFirstOf(PROTOCOL);
if (!protocol)
+1 -1
View File
@@ -48,7 +48,7 @@ void Mail::Message::Run()
if (this->dont_quote_addresses)
fprintf(pipe, "To: %s <%s>\r\n", mail_to.c_str(), addr.c_str());
else
fprintf(pipe, "To: \"%s\" <%s>\r\n", mail_to.c_str(), addr.c_str());
fprintf(pipe, "To: \"%s\" <%s>\r\n", mail_to.replace_all_cs("\\", "\\\\").c_str(), addr.c_str());
fprintf(pipe, "Subject: %s\r\n", subject.c_str());
fprintf(pipe, "Content-Type: %s\r\n", content_type.c_str());
fprintf(pipe, "Content-Transfer-Encoding: 8bit\r\n");
+2 -2
View File
@@ -55,7 +55,7 @@ void ModuleManager::CleanupRuntimeDirectory()
*/
static ModuleReturn moduleCopyFile(const Anope::string &name, Anope::string &output)
{
const auto input = Anope::ExpandModule("modules/" + name + DLL_EXT);
const auto input = Anope::ExpandModule(name + DLL_EXT);
struct stat s;
if (stat(input.c_str(), &s) == -1)
@@ -146,7 +146,7 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u)
return ret;
}
#else
const auto pbuf = Anope::ExpandModule("modules/" + modname + DLL_EXT);
const auto pbuf = Anope::ExpandModule(modname + DLL_EXT);
#endif
dlerror();
+3
View File
@@ -216,6 +216,9 @@ Serializable *NickAlias::Unserialize(Serializable *obj, Serialize::Data &data)
data["extensible:NO_EXPIRE"] >> b;
if (b)
na->Extend<bool>("NS_NO_EXPIRE");
if (na->time_registered < na->nc->time_registered)
na->nc->time_registered = na->time_registered;
/* end compat */
return na;
+5 -9
View File
@@ -73,7 +73,9 @@ void NickCore::Serialize(Serialize::Data &data) const
data["pass"] << this->pass;
data["email"] << this->email;
data["language"] << this->language;
data["lastmail"] << this->lastmail;
data.SetType("lastmail", Serialize::Data::DT_INT); data["lastmail"] << this->lastmail;
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
data["memomax"] << this->memos.memomax;
for (const auto &ignore : this->memos.ignores)
data["memoignores"] << ignore << " ";
@@ -99,6 +101,7 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
data["email"] >> nc->email;
data["language"] >> nc->language;
data["lastmail"] >> nc->lastmail;
data["time_registered"] >> nc->time_registered;
data["memomax"] >> nc->memos.memomax;
{
Anope::string buf;
@@ -206,14 +209,7 @@ uint64_t NickCore::GetId()
if (this->id)
return this->id;
NickAlias *na = NickAlias::Find(this->display);
if (!na)
{
Log(LOG_DEBUG) << "Unable to find the display NickAlias for NickCore: " << this->display;
return 0;
}
Anope::string secretid = this->display + "\0" + Anope::ToString(na->time_registered);
Anope::string secretid = this->display + "\0" + Anope::ToString(this->time_registered);
// Generate the account id. This should almost always only have one
// iteration but in the rare case that we generate a duplicate id we try
+9
View File
@@ -18,6 +18,7 @@ foreach(SRC ${TOOLS_SRCS})
# Set the executable to be installed to the bin directory under the main directory
install(TARGETS ${EXE}
DESTINATION ${BIN_DIR}
RUNTIME
)
# Add the executable to the list of files for CPack to ignore
set(EXE_BINARY "$<TARGET_FILE:${EXE}>")
@@ -28,6 +29,14 @@ endforeach()
# If not on Windows, generate anoperc and install it along with mydbgen
if(NOT WIN32)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
configure_file(${Anope_SOURCE_DIR}/src/tools/anope.service.in ${Anope_BINARY_DIR}/src/tools/anope.service)
install(
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anope.service
DESTINATION ${BIN_DIR}
)
endif()
configure_file(${Anope_SOURCE_DIR}/src/tools/anoperc.in ${Anope_BINARY_DIR}/src/tools/anoperc)
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anoperc
DESTINATION ${BIN_DIR}
+17
View File
@@ -0,0 +1,17 @@
[Unit]
After=network.target
Description=Anope IRC Services
Documentation=https://wiki.anope.org/
After=network-online.target
Wants=network-online.target
[Service]
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=@BIN_DIR@/@PROGRAM_NAME@ --nofork
Restart=on-failure
Type=simple
WorkingDirectory=@CMAKE_INSTALL_PREFIX@
[Install]
WantedBy=multi-user.target
+2 -2
View File
@@ -825,14 +825,14 @@ Anope::string User::Mask() const
bool User::BadPassword()
{
if (!Config->GetBlock("options")->Get<int>("badpasslimit"))
if (!Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
return false;
if (Config->GetBlock("options")->Get<time_t>("badpasstimeout") > 0 && this->invalid_pw_time > 0 && this->invalid_pw_time < Anope::CurTime - Config->GetBlock("options")->Get<time_t>("badpasstimeout"))
this->invalid_pw_count = 0;
++this->invalid_pw_count;
this->invalid_pw_time = Anope::CurTime;
if (this->invalid_pw_count >= Config->GetBlock("options")->Get<int>("badpasslimit"))
if (this->invalid_pw_count >= Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
{
this->Kill(Me, "Too many invalid passwords");
return true;
+1 -1
View File
@@ -2,5 +2,5 @@
VERSION_MAJOR=2
VERSION_MINOR=1
VERSION_PATCH=4
VERSION_PATCH=6
VERSION_EXTRA=""