[asterisk-commits] murf: branch 1.4 r43505 - /branches/1.4/pbx/pbx_ael.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Sep 22 14:08:36 MST 2006


Author: murf
Date: Fri Sep 22 16:08:36 2006
New Revision: 43505

URL: http://svn.digium.com/view/asterisk?rev=43505&view=rev
Log:
If the extensions.ael file not found, or unreadable, we return AST_MODULE_LOAD_DECLINE,
as per bug # 8004.



Modified:
    branches/1.4/pbx/pbx_ael.c

Modified: branches/1.4/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_ael.c?rev=43505&r1=43504&r2=43505&view=diff
==============================================================================
--- branches/1.4/pbx/pbx_ael.c (original)
+++ branches/1.4/pbx/pbx_ael.c Fri Sep 22 16:08:36 2006
@@ -28,6 +28,7 @@
 
 #include <sys/types.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -3803,6 +3804,11 @@
 		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);



More information about the asterisk-commits mailing list