mirror of
https://github.com/anope/anope.git
synced 2026-06-16 05:24:47 +02:00
Compare commits
62 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 756dc49813 | |||
| aa92559aa0 | |||
| eb12a89b8e | |||
| d4a34308e5 | |||
| aab3a8e5b6 | |||
| c72e12d0a6 | |||
| bce0d629fd | |||
| 7d0dacc86c | |||
| 729aa4ab4a | |||
| 18e9e12261 | |||
| 9d68b29c9e | |||
| a4792412ba | |||
| 8bb83f6b1a | |||
| da99a53dfa | |||
| a9e9ac32a0 | |||
| 05e6df23a2 | |||
| 3f9fc23270 | |||
| cb21c7c1fa | |||
| 4008e64f26 | |||
| 1cf5918574 | |||
| afe87bf693 | |||
| ff1c5adb8b | |||
| c36030c826 | |||
| 33a02b1223 | |||
| 68f4556609 | |||
| 23db58a303 | |||
| ee69dc3105 | |||
| e9243c3fde | |||
| 4cfee23303 | |||
| be3822523b | |||
| 111f81aa95 | |||
| f12e1ad222 | |||
| 72318a6bf0 | |||
| 2f77cb38e2 | |||
| 84ca4c0d27 | |||
| 1f9a197b18 | |||
| 0c5bf51378 | |||
| 1647968c50 | |||
| 5473311bd7 | |||
| f3ebb67469 | |||
| 0d149ce195 | |||
| d68ba1b570 | |||
| 1877833e73 | |||
| 63c3710785 | |||
| 0043d137e5 | |||
| 3e5d3c5bdc | |||
| 62deedfa75 | |||
| 44af4eac6b | |||
| 5fdc637327 | |||
| 7c93007aa6 | |||
| e8fee93a7e | |||
| 260539e987 | |||
| 4603cd467b | |||
| 00549bc9b2 | |||
| e0a6f7456b | |||
| 5a54b37aeb | |||
| 2e43665266 | |||
| 8b4cd65e2a | |||
| c08aaa86d1 | |||
| 87a8af0ad7 | |||
| 4691dfa3f0 | |||
| d41764bfd6 |
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"; }
|
||||
|
||||
/*
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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") { }
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,8 @@ public:
|
||||
class CoreExport NotImplementedException final
|
||||
: public CoreException
|
||||
{
|
||||
public:
|
||||
NotImplementedException() : CoreException("") { }
|
||||
};
|
||||
|
||||
/** Every module in Anope is actually a class.
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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
File diff suppressed because it is too large
Load Diff
+230
-364
File diff suppressed because it is too large
Load Diff
@@ -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
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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";
|
||||
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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> ¶ms, 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> ¶ms, 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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
@@ -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,5 +1,5 @@
|
||||
build_subdir(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
install(DIRECTORY "templates/"
|
||||
DESTINATION "${DB_DIR}/webcpanel/templates/default"
|
||||
DESTINATION "${DATA_DIR}/webcpanel/templates/default"
|
||||
)
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -95,4 +95,5 @@ endif()
|
||||
# Set Anope to be installed to the bin directory
|
||||
install(TARGETS ${PROGRAM_NAME}
|
||||
DESTINATION ${BIN_DIR}
|
||||
RUNTIME
|
||||
)
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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
@@ -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
@@ -2,5 +2,5 @@
|
||||
|
||||
VERSION_MAJOR=2
|
||||
VERSION_MINOR=1
|
||||
VERSION_PATCH=4
|
||||
VERSION_PATCH=6
|
||||
VERSION_EXTRA=""
|
||||
|
||||
Reference in New Issue
Block a user