mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 02:03:14 +02:00
Add log::flags "flood" to log flood messages
This commit is contained in:
@@ -265,7 +265,7 @@ drpass {
|
||||
* See also https://www.unrealircd.org/docs/Log_block
|
||||
*/
|
||||
|
||||
/* This is a good default, it logs almost everything */
|
||||
/* This is a good default, it logs everything */
|
||||
log "ircd.log" {
|
||||
flags {
|
||||
oper;
|
||||
@@ -273,6 +273,7 @@ log "ircd.log" {
|
||||
server-connects;
|
||||
kills;
|
||||
errors;
|
||||
flood;
|
||||
sadmin-commands;
|
||||
chg-commands;
|
||||
oper-override;
|
||||
|
||||
@@ -212,6 +212,7 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
|
||||
#define LOG_CHGCMDS 0x0100
|
||||
#define LOG_OVERRIDE 0x0200
|
||||
#define LOG_SPAMFILTER 0x0400
|
||||
#define LOG_FLOOD 0x0800
|
||||
|
||||
/*
|
||||
** 'offsetof' is defined in ANSI-C. The following definition
|
||||
|
||||
@@ -163,6 +163,7 @@ static NameValue _LogFlags[] = {
|
||||
{ LOG_CHGCMDS, "chg-commands" },
|
||||
{ LOG_CLIENT, "connects" },
|
||||
{ LOG_ERROR, "errors" },
|
||||
{ LOG_FLOOD, "flood" },
|
||||
{ LOG_KILL, "kills" },
|
||||
{ LOG_KLINE, "kline" },
|
||||
{ LOG_OPER, "oper" },
|
||||
|
||||
+5
-2
@@ -942,18 +942,21 @@ char *get_connect_extinfo(Client *client)
|
||||
|
||||
/** Log a message that flood protection kicked in for the client.
|
||||
* This sends to the +f snomask at the moment.
|
||||
* FIXME: we should provide an option to log this too?
|
||||
* @param client The client to check flood for (local user)
|
||||
* @param opt The flood option (eg FLD_AWAY)
|
||||
*/
|
||||
void flood_limit_exceeded_log(Client *client, char *floodname)
|
||||
{
|
||||
sendto_snomask_global(SNO_FLOOD, "Flood blocked (%s) from %s!%s@%s [%s]",
|
||||
char buf[1024];
|
||||
|
||||
snprintf(buf, sizeof(buf), "Flood blocked (%s) from %s!%s@%s [%s]",
|
||||
floodname,
|
||||
client->name,
|
||||
client->user->username,
|
||||
client->user->realhost,
|
||||
GetIP(client));
|
||||
ircd_log(LOG_FLOOD, "%s", buf);
|
||||
sendto_snomask_global(SNO_FLOOD, "%s", buf);
|
||||
}
|
||||
|
||||
/** Is the flood limit exceeded for an option? eg for away-flood.
|
||||
|
||||
Reference in New Issue
Block a user