mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +00:00
so that paths and filename are writable by asterisk.c without causing segfaults. This involves defining the variables as const char *, and having them point to as static, writable buffer defined in asterisk.c On passing, fix some errors in using these variables in some files in utils/ , and in res/snmp/agent.c which was redefining a variable without using paths.h (not applicable to 1.4) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@94168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -82,8 +82,11 @@ struct namelist *globalvars_last;
|
||||
|
||||
int conts=0, extens=0, priors=0;
|
||||
char last_exten[18000];
|
||||
const char ast_config_AST_CONFIG_DIR[PATH_MAX];
|
||||
const char ast_config_AST_VAR_DIR[PATH_MAX];
|
||||
|
||||
static char config_dir[PATH_MAX];
|
||||
static char var_dir[PATH_MAX];
|
||||
const char *ast_config_AST_CONFIG_DIR = config_dir;
|
||||
const char *ast_config_AST_VAR_DIR = var_dir;
|
||||
|
||||
void ast_cli_register_multiple(void);
|
||||
int ast_add_extension2(struct ast_context *con,
|
||||
@@ -514,14 +517,14 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if( use_curr_dir ) {
|
||||
strcpy((char *)ast_config_AST_CONFIG_DIR, ".");
|
||||
strcpy(config_dir, ".");
|
||||
localized_use_local_dir();
|
||||
}
|
||||
else {
|
||||
strcpy((char *)ast_config_AST_CONFIG_DIR, "/etc/asterisk");
|
||||
strcpy(config_dir, "/etc/asterisk");
|
||||
localized_use_conf_dir();
|
||||
}
|
||||
strcpy((char *)ast_config_AST_VAR_DIR, "/var/lib/asterisk");
|
||||
strcpy(var_dir, "/var/lib/asterisk");
|
||||
|
||||
if( dump_extensions ) {
|
||||
dumpfile = fopen("extensions.conf.aeldump","w");
|
||||
|
||||
Reference in New Issue
Block a user