-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dwfreed/callerid-cleanup
- Loading branch information
Showing
54 changed files
with
809 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,12 @@ Solanum is based on Charybdis, which was based on ircd-ratbox. | |
Development is led by a group of representatives from Libera Chat | ||
and OFTC: | ||
|
||
amdj, Aaron Jones <[email protected]> | ||
dwfreed, Doug Freed <[email protected]> | ||
edk, Ed Kellett <[email protected]> | ||
glguy, Eric Mertens <[email protected]> | ||
ilbelkyr, Nicole Kleinhoff <[email protected]> | ||
mcintosh, Richie McIntosh <[email protected]> | ||
Myon, Christoph Berg <[email protected]> | ||
spb, Stephen Bennet <[email protected]> | ||
tomaw, Tom Wesley <[email protected]> | ||
|
||
The Charybdis team was: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
extensions/filter module documentation | ||
-------------------------------------- | ||
|
||
The filter extension implements message content filtering using | ||
solanum's hook framework and Intel's Hyperscan regular expression | ||
matching library. | ||
|
||
It requires an x86_64 processor with SSSE3 extensions. | ||
|
||
To operate, the filter requires a database of regular expessions | ||
that have been compiled using the Hyperscan library's | ||
hs_compile_multi() or hs_compile_ext_multi() functions. | ||
|
||
The command SETFILTER is used to manage operation of the filter and to | ||
load compiled Hyperscan databases. | ||
|
||
General documenation of SETFILTER is available using the 'HELP SETFILTER' | ||
command. | ||
|
||
For each expression in the database, the three least significant bits | ||
of the expression ID are used to indicate which action the ircd should | ||
take in the event of a match: | ||
|
||
001 (1) DROP - The message will be dropped and the client will be sent | ||
an ERR_CANNOTSENDTOCHAN message. | ||
010 (2) KILL - The connection from which the message was recevied will | ||
be closed. | ||
100 (4) ALARM - A Server Notice will be generated indicating that an | ||
expression was matched. The nick, user, hostname and | ||
IP address will be reported. For privacy, the expression | ||
that has been matched will not be disclosed. | ||
|
||
Messages are passed to the filter module in a format similar to an | ||
IRC messages: | ||
|
||
0:nick!user@host#1 PRIVMSG #help :hello! | ||
|
||
The number at the start of the line indicates the scanning pass: | ||
Messages are scanned twice, once as they were received (0), and once | ||
with any formatting or unprintable characters stripped (1). | ||
|
||
By default, 'nick', 'user' and 'host' will contain *. This behaviour | ||
can be changed at build time if filtering on these fields is required. | ||
|
||
The number after the # will be 0 or 1 depending on whether the sending | ||
client was identified to a NickServ account. | ||
|
||
The process for loading filters is as follows: | ||
|
||
1. The Hyperscan database is serialized using hs_serialize_database(). | ||
2. A 'SETFILTER NEW' command is sent. | ||
3. The serialized data is split into chunks and base64 encoded. | ||
The chunk size needs to be chosen to ensure that the resuliting | ||
strings are short enough to fit into a 510 byte IRC line, taking | ||
into account space needed for the 'SETFILTER +' command, check field, | ||
server mask, and base64 overhead. | ||
4. The encoded chunks are sent using 'SETFILTER +' commands | ||
5. Once the entire database has been sent, a 'SETFILTER APPLY' command | ||
is sent to commit it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Guest extban type: bans unidentified users matching nick!user@host. | ||
* -- TheDaemoness | ||
*/ | ||
|
||
#include "stdinc.h" | ||
#include "modules.h" | ||
#include "client.h" | ||
#include "ircd.h" | ||
|
||
static const char extb_desc[] = "Guest ($g) extban type - bans unidentified users matching nick!user@host"; | ||
|
||
static int _modinit(void); | ||
static void _moddeinit(void); | ||
static int eb_guest(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); | ||
|
||
DECLARE_MODULE_AV2(extb_guest, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); | ||
|
||
static int | ||
_modinit(void) | ||
{ | ||
extban_table['g'] = eb_guest; | ||
|
||
return 0; | ||
} | ||
|
||
static void | ||
_moddeinit(void) | ||
{ | ||
extban_table['g'] = NULL; | ||
} | ||
|
||
static int eb_guest(const char *data, struct Client *client_p, | ||
struct Channel *chptr, long mode_type) | ||
{ | ||
(void)chptr; | ||
|
||
if (data == NULL) | ||
return EXTBAN_INVALID; | ||
|
||
const char *idx = strchr(data, '#'); | ||
|
||
if (idx != NULL && idx[1] == '\0') | ||
/* Users cannot have empty realnames, | ||
* so don't let a ban be set matching one | ||
*/ | ||
return EXTBAN_INVALID; | ||
|
||
if (!EmptyString(client_p->user->suser)) | ||
return EXTBAN_NOMATCH; | ||
|
||
if (idx != NULL) | ||
{ | ||
char buf[BUFSIZE]; | ||
|
||
// Copy the nick!user@host part of the ban | ||
memcpy(buf, data, (idx - data)); | ||
buf[(idx - data)] = '\0'; | ||
|
||
// Advance to the realname part of the ban | ||
idx++; | ||
|
||
if (client_matches_mask(client_p, buf) && match(idx, client_p->info)) | ||
return EXTBAN_MATCH; | ||
|
||
return EXTBAN_NOMATCH; | ||
} | ||
|
||
if (client_matches_mask(client_p, data)) | ||
return EXTBAN_MATCH; | ||
|
||
return EXTBAN_NOMATCH; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.