From 1702b69419611c8e154b9c59c90b68ccdea59f56 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 14 Mar 2010 17:21:20 +0100 Subject: [PATCH] Add option general::use_propagated_bans to allow disabling new KLINE. If this option is yes (default), KLINE by itself sets global (propagated) bans. If this option is no, KLINE by itself sets a local kline following cluster{}, compatible with 3.2 and older versions. --- doc/example.conf | 1 + doc/reference.conf | 7 +++++++ include/s_conf.h | 1 + modules/m_info.c | 6 ++++++ modules/m_kline.c | 2 +- src/newconf.c | 1 + src/s_conf.c | 1 + 7 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/example.conf b/doc/example.conf index 6a79129ee..4848ed04f 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -457,6 +457,7 @@ general { identify_command = "IDENTIFY"; non_redundant_klines = yes; warn_no_nline = yes; + use_propagated_bans = yes; stats_e_disabled = no; stats_c_oper_only=no; stats_h_oper_only=no; diff --git a/doc/reference.conf b/doc/reference.conf index 10971d4d5..ce2831092 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -1030,6 +1030,13 @@ general { */ warn_no_nline = yes; + /* use propagated bans: KLINE sets fully propagated bans. That means + * the klines are part of the netburst and restarted/split servers + * will get them, but they will not apply to 3.2 and older servers + * at all. + */ + use_propagated_bans = yes; + /* stats e disabled: disable stats e. useful if server ips are * exempted and you dont want them listing on irc. */ diff --git a/include/s_conf.h b/include/s_conf.h index 4cacc5e0c..03d78a668 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -223,6 +223,7 @@ struct config_file_entry int default_umodes; int global_snotices; int operspy_dont_care_user_info; + int use_propagated_bans; }; struct config_channel_entry diff --git a/modules/m_info.c b/modules/m_info.c index d3ddb3b88..3cdd7ba43 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -482,6 +482,12 @@ static struct InfoStruct info_table[] = { &ConfigFileEntry.warn_no_nline, "Display warning if connecting server lacks N-line" }, + { + "use_propagated_bans", + OUTPUT_BOOLEAN, + &ConfigFileEntry.use_propagated_bans, + "KLINE sets fully propagated bans" + }, { "default_split_server_count", OUTPUT_DECIMAL, diff --git a/modules/m_kline.c b/modules/m_kline.c index 46ff73040..364c30b0f 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -107,7 +107,7 @@ mo_kline(struct Client *client_p, struct Client *source_p, int parc, const char struct ConfItem *aconf; int tkline_time = 0; int loc = 1; - int propagated = 1; + int propagated = ConfigFileEntry.use_propagated_bans; if(!IsOperK(source_p)) { diff --git a/src/newconf.c b/src/newconf.c index 24749a833..307d08905 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2175,6 +2175,7 @@ static struct ConfEntry conf_general_table[] = { "ts_warn_delta", CF_TIME, NULL, 0, &ConfigFileEntry.ts_warn_delta }, { "use_whois_actually", CF_YESNO, NULL, 0, &ConfigFileEntry.use_whois_actually }, { "warn_no_nline", CF_YESNO, NULL, 0, &ConfigFileEntry.warn_no_nline }, + { "use_propagated_bans",CF_YESNO, NULL, 0, &ConfigFileEntry.use_propagated_bans }, { "\0", 0, NULL, 0, NULL } }; diff --git a/src/s_conf.c b/src/s_conf.c index 946380dbb..11d2d0a10 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -744,6 +744,7 @@ set_default_conf(void) ConfigFileEntry.collision_fnc = YES; ConfigFileEntry.global_snotices = YES; ConfigFileEntry.operspy_dont_care_user_info = NO; + ConfigFileEntry.use_propagated_bans = YES; #ifdef HAVE_LIBZ ConfigFileEntry.compression_level = 4;