From 3836bbd55742c1a7d23cc2e242ad7ed3edbdf33f Mon Sep 17 00:00:00 2001 From: Steve Murphy Date: Fri, 22 Sep 2006 21:08:36 +0000 Subject: [PATCH] If the extensions.ael file not found, or unreadable, we return AST_MODULE_LOAD_DECLINE, as per bug # 8004. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43505 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx/pbx_ael.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c index 791a58c3c3..f460b630f6 100644 --- a/pbx/pbx_ael.c +++ b/pbx/pbx_ael.c @@ -28,6 +28,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include #include +#include #include #include #include @@ -3803,6 +3804,11 @@ static int pbx_load_module(void) sprintf(rfilename, "%s/%s", ast_config_AST_CONFIG_DIR, config); } ast_log(LOG_NOTICE, "AEL load process: calculated config file name '%s'.\n", rfilename); + + if (access(rfilename,R_OK) != 0) { + ast_log(LOG_NOTICE, "File %s not found; AEL declining load\n", rfilename); + return AST_MODULE_LOAD_DECLINE; + } parse_tree = ael2_parse(rfilename, &errs); ast_log(LOG_NOTICE, "AEL load process: parsed config file name '%s'.\n", rfilename);