From cbcbdc656a8f7bd1f58a4fd7ea0cf04dfa180859 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Thu, 29 Dec 2016 10:38:10 +0100 Subject: [PATCH] The 'class' block is now always read before 'allow'. No specific order required anymore. --- src/s_conf.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/s_conf.c b/src/s_conf.c index a8b9879f0..aa1431eed 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -2272,15 +2272,30 @@ int config_run() } } - /* Stage 2: now all the rest */ + /* Stage 2: now class blocks */ for (cfptr = conf; cfptr; cfptr = cfptr->cf_next) { if (config_verbose > 1) config_status("Running %s", cfptr->cf_filename); for (ce = cfptr->cf_entries; ce; ce = ce->ce_next) { - if (!strcmp(ce->ce_varname, "set")) - continue; // skip set block, already done + if (!strcmp(ce->ce_varname, "class")) + { + if (_conf_class(cfptr, ce) < 0) + errors++; + } + } + } + + /* Stage 3: now all the rest */ + for (cfptr = conf; cfptr; cfptr = cfptr->cf_next) + { + if (config_verbose > 1) + config_status("Running %s", cfptr->cf_filename); + for (ce = cfptr->cf_entries; ce; ce = ce->ce_next) + { + if (!strcmp(ce->ce_varname, "set") || !strcmp(ce->ce_varname, "class")) + continue; // already processed if ((cc = config_binary_search(ce->ce_varname))) { if ((cc->conffunc) && (cc->conffunc(cfptr, ce) < 0))