aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-25 20:49:42 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-25 20:49:42 +0000
commiteb775320ab11b7a007c46f5fc3a65254d67c7723 (patch)
tree2e92fff235dd4c16a461bd7a4b75abca6de57908 /main
parent2c9e764508bd70c6c1430422e0e8dc4eae163022 (diff)
Allow the use of #include and #exec in situations where the max include depth was only 1.
Specifically, this fixes using #include and #exec in extconfig.conf. This was basically caused because the config file itself raises the include level to 1. I opted not to raise the include limit, because recursion here could cause very bizarre behavior. Pointed out, and tested by jmls (closes issue #12064) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104092 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/config.c b/main/config.c
index 7e0bd57d7..2740640a5 100644
--- a/main/config.c
+++ b/main/config.c
@@ -1330,7 +1330,8 @@ struct ast_config *ast_config_internal_load(const char *filename, struct ast_con
struct ast_config_engine *loader = &text_file_engine;
struct ast_config *result;
- if (cfg->include_level == cfg->max_include_level) {
+ /* The config file itself bumps include_level by 1 */
+ if (cfg->max_include_level > 0 && cfg->include_level == cfg->max_include_level + 1) {
ast_log(LOG_WARNING, "Maximum Include level (%d) exceeded\n", cfg->max_include_level);
return NULL;
}