]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Allow the use of #include and #exec in situations where the max include depth was...
authorJason Parker <jparker@digium.com>
Mon, 25 Feb 2008 20:49:42 +0000 (20:49 +0000)
committerJason Parker <jparker@digium.com>
Mon, 25 Feb 2008 20:49:42 +0000 (20:49 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@104092 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/config.c

index 7e0bd57d7881d93a66ba80f6694f20308a61a4b2..2740640a5563ccd5dfdba9af8c7270ade6e65c49 100644 (file)
@@ -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;
        }