Mercurial > hg > freeDiameter
changeset 511:17435072de36
Search extensions conf files in the main configuration folder also
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 20 Aug 2010 15:18:58 +0900 |
parents | 48d306c0db29 |
children | 16224de837fd |
files | extensions/app_diameap/diameap.y extensions/app_radgw/rgwx_echodrop.y |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/extensions/app_diameap/diameap.y Fri Aug 20 14:28:45 2010 +0900 +++ b/extensions/app_diameap/diameap.y Fri Aug 20 15:18:58 2010 +0900 @@ -133,9 +133,9 @@ fl = fopen(cfile, "r"); if ((fl == NULL) && (*cfile != '/')) { char * tmp = cfile; - CHECK_MALLOC_DO( cfile = malloc( strlen(tmp) + strlen(DEFAULT_EXTENSIONS_PATH) + 2 ), + CHECK_MALLOC_DO( cfile = malloc( strlen(tmp) + strlen(DEFAULT_CONF_PATH) + 2 ), { yyerror (&yylloc, config, "Not enough memory"); YYERROR; } ); - sprintf(cfile, DEFAULT_EXTENSIONS_PATH "/%s", tmp); + sprintf(cfile, DEFAULT_CONF_PATH "/%s", tmp); free(tmp); fl = fopen(cfile, "r"); }
--- a/extensions/app_radgw/rgwx_echodrop.y Fri Aug 20 14:28:45 2010 +0900 +++ b/extensions/app_radgw/rgwx_echodrop.y Fri Aug 20 15:18:58 2010 +0900 @@ -68,6 +68,13 @@ int ret; rgwx_echodropin = fopen(conffile, "r"); + if ((rgwx_echodropin == NULL) && (*conffile != '/')) { /* We received a relative path, try adding DEFAULT_CONF_PATH prefix */ + char * fullpath; + CHECK_MALLOC( fullpath = malloc( strlen(conffile) + strlen(DEFAULT_CONF_PATH) + 2 ) ); + sprintf( fullpath, DEFAULT_CONF_PATH "/%s", conffile ); + rgwx_echodropin = fopen(fullpath, "r"); + free(fullpath); + } if (rgwx_echodropin == NULL) { ret = errno; fd_log_debug("[echodrop.rgwx] Unable to open plugin configuration file %s for reading: %s\n", conffile, strerror(ret));