From 1cc810d3a7bf3f30a6caf13488f581cf93681fb9 Mon Sep 17 00:00:00 2001 From: JD Horelick Date: Sun, 21 Mar 2010 00:14:02 -0400 Subject: [PATCH] Add general::true_no_oper_flood . I'm not going to explain it here. Ask me what it does on IRC if you're curious. --- doc/example.conf | 1 + doc/reference.conf | 7 +++++++ include/s_conf.h | 1 + modules/m_info.c | 6 ++++++ src/newconf.c | 1 + src/packet.c | 9 +++++++-- src/s_conf.c | 1 + 7 files changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/example.conf b/doc/example.conf index bd8e65e..3a852a4 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -550,6 +550,7 @@ general { connect_timeout = 30 seconds; disable_auth = no; no_oper_flood = yes; + true_no_oper_flood = no; max_targets = 4; client_flood = 20; use_whois_actually = no; diff --git a/doc/reference.conf b/doc/reference.conf index 1c08d0c..bc1262f 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -1284,6 +1284,13 @@ general { /* no oper flood: increase flood limits for opers. */ no_oper_flood = yes; + /* true no oper flood: Allow opers to NEVER hit flood limits. + * With the above setting, flood limits are set to 4x what they + * are for normal users. With this setting, they're removed entirely. + * ENABLE THIS SETTING WITH CAUTION. + */ + true_no_oper_flood = no; + /* REMOVE ME. The following line checks you've been reading. */ havent_read_conf = yes; diff --git a/include/s_conf.h b/include/s_conf.h index ae87cf7..3ceb2b5 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -189,6 +189,7 @@ struct config_file_entry int pace_wait_simple; int short_motd; int no_oper_flood; + int true_no_oper_flood; int hide_server; int hide_spoof_ips; int hide_error_messages; diff --git a/modules/m_info.c b/modules/m_info.c index 4501a18..716ca9d 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -374,6 +374,12 @@ static struct InfoStruct info_table[] = { &ConfigFileEntry.no_oper_flood, "Disable flood control for operators", }, + { + "true_no_oper_flood", + OUTPUT_BOOLEAN, + &ConfigFileEntry.true_no_oper_flood, + "Really disable flood control for opers, not just make it very high", + }, { "non_redundant_klines", OUTPUT_BOOLEAN, diff --git a/src/newconf.c b/src/newconf.c index 90b88e8..6791044 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2226,6 +2226,7 @@ static struct ConfEntry conf_general_table[] = { "min_nonwildcard", CF_INT, NULL, 0, &ConfigFileEntry.min_nonwildcard }, { "nick_delay", CF_TIME, NULL, 0, &ConfigFileEntry.nick_delay }, { "no_oper_flood", CF_YESNO, NULL, 0, &ConfigFileEntry.no_oper_flood }, + { "true_no_oper_flood", CF_YESNO, NULL, 0, &ConfigFileEntry.true_no_oper_flood }, { "operspy_admin_only", CF_YESNO, NULL, 0, &ConfigFileEntry.operspy_admin_only }, { "operspy_dont_care_user_info", CF_YESNO, NULL, 0, &ConfigFileEntry.operspy_dont_care_user_info }, { "secret_channels_in_whois", CF_YESNO, NULL, 0, &ConfigFileEntry.secret_channels_in_whois }, diff --git a/src/packet.c b/src/packet.c index fb8dcab..6090b7d 100644 --- a/src/packet.c +++ b/src/packet.c @@ -99,7 +99,12 @@ parse_client_queued(struct Client *client_p) { if(IsOper(client_p) && ConfigFileEntry.no_oper_flood) - checkflood = 0; + { + if (ConfigFileEntry.true_no_oper_flood) + checkflood = -1; + else + checkflood = 0; + } /* * Handle flood protection here - if we exceed our flood limit on * messages in this loop, we simply drop out of the loop prematurely. @@ -129,7 +134,7 @@ parse_client_queued(struct Client *client_p) /* allow opers 4 times the amount of messages as users. why 4? * why not. :) --fl_ */ - else if(client_p->localClient->sent_parsed >= (4 * client_p->localClient->allow_read)) + else if(client_p->localClient->sent_parsed >= (4 * client_p->localClient->allow_read) && checkflood != -1) break; dolen = rb_linebuf_get(&client_p->localClient-> diff --git a/src/s_conf.c b/src/s_conf.c index ef704d2..4263528 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -720,6 +720,7 @@ set_default_conf(void) ConfigFileEntry.pace_wait_simple = 1; ConfigFileEntry.short_motd = NO; ConfigFileEntry.no_oper_flood = NO; + ConfigFileEntry.true_no_oper_flood = NO; ConfigFileEntry.fname_userlog = NULL; ConfigFileEntry.fname_fuserlog = NULL; ConfigFileEntry.fname_operlog = NULL;