diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-22 21:08:36 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-22 21:08:36 +0000 |
commit | dbb12b59df4e2ebfd5f40c998b6e102b5a80c59f (patch) | |
tree | 61f74b212ba717cce205d6e2cb98b78a48dd1793 /pbx/pbx_ael.c | |
parent | 3d14da234de3349f9cee9dc44625e5ceee167467 (diff) |
If the extensions.ael file not found, or unreadable, we return AST_MODULE_LOAD_DECLINE,
as per bug # 8004.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43505 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_ael.c')
-rw-r--r-- | pbx/pbx_ael.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c index 791a58c3c..f460b630f 100644 --- a/pbx/pbx_ael.c +++ b/pbx/pbx_ael.c @@ -28,6 +28,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <sys/types.h> #include <stdlib.h> +#include <unistd.h> #include <stdio.h> #include <string.h> #include <ctype.h> @@ -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); |