From b2bfff26a2a87f96adc2c4a5ba6c3ef5641d3ee3 Mon Sep 17 00:00:00 2001 From: Holbrook Bunting Date: Tue, 5 Apr 2022 01:25:10 -0700 Subject: [PATCH 1/3] Allow Blocks Order Issue 189 Allow blocks now always in same order as in conf file. --- src/s_conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/s_conf.c b/src/s_conf.c index 1bf3f309..57911238 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -2226,7 +2226,10 @@ merge_confs() merge_classes(); /* this should always be done first */ merge_me(); merge_connects(); + + MyFree(allows); // Clear then readd Allow blocks in same order as in conf -Holbrook merge_allows(); + merge_opers(); merge_ports(); merge_options(); From cdd01d2f8fd7bd2a8668042766b08f5038c3c2d8 Mon Sep 17 00:00:00 2001 From: Holbrook Bunting Date: Tue, 5 Apr 2022 15:21:12 -0700 Subject: [PATCH 2/3] Update s_conf.c Remove current allow blocks too. --- src/s_conf.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/s_conf.c b/src/s_conf.c index 57911238..b5855fff 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -1867,6 +1867,28 @@ set_classes(void) } +void remove_allows() +{ + aAllow *allow, *ptr = NULL; + + allow = allows; + + while (allow) + { + ptr = allow->next; + allows = allow->next; + + allow->class->refs--; + expire_class(allow->class); + free_allow(allow); + + allow = ptr; + } + + MyFree(allows); + return; +} + /* merge routines. used to mirge together new lists and old lists * after a rehash. Feb27/04 -epi */ @@ -2227,7 +2249,8 @@ merge_confs() merge_me(); merge_connects(); - MyFree(allows); // Clear then readd Allow blocks in same order as in conf -Holbrook + // Clear out current allow blocks first, then add them all back from ircd.conf -Holbrook + remove_allows(); merge_allows(); merge_opers(); From e86b670829429b8d073fd922034889c44e41f9d8 Mon Sep 17 00:00:00 2001 From: Holbrook Bunting Date: Tue, 5 Apr 2022 15:37:19 -0700 Subject: [PATCH 3/3] Update s_conf.c A little cosmetic change --- src/s_conf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/s_conf.c b/src/s_conf.c index b5855fff..3d62f59b 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -1866,12 +1866,9 @@ set_classes(void) return NULL; } - void remove_allows() { - aAllow *allow, *ptr = NULL; - - allow = allows; + aAllow *allow = allows, *ptr = NULL; while (allow) {