mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
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
This commit is contained in:
@@ -28,6 +28,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -3803,6 +3804,11 @@ static int pbx_load_module(void)
|
|||||||
sprintf(rfilename, "%s/%s", ast_config_AST_CONFIG_DIR, config);
|
sprintf(rfilename, "%s/%s", ast_config_AST_CONFIG_DIR, config);
|
||||||
}
|
}
|
||||||
ast_log(LOG_NOTICE, "AEL load process: calculated config file name '%s'.\n", rfilename);
|
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);
|
parse_tree = ael2_parse(rfilename, &errs);
|
||||||
ast_log(LOG_NOTICE, "AEL load process: parsed config file name '%s'.\n", rfilename);
|
ast_log(LOG_NOTICE, "AEL load process: parsed config file name '%s'.\n", rfilename);
|
||||||
|
Reference in New Issue
Block a user