summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/radius.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-07-19 19:07:42 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-07-19 19:07:42 +0400
commit09b155588131d8ed6f380aec467d0fa7749933b8 (patch)
treeaa31d14ac81cc6b653daa7fdfac296bfa5a9f69e /accel-pppd/radius/radius.c
parentca1779b61f9a1f8390d964bf9d76c0f12caa25ed (diff)
downloadaccel-ppp-09b155588131d8ed6f380aec467d0fa7749933b8.tar.gz
accel-ppp-09b155588131d8ed6f380aec467d0fa7749933b8.zip
radius: multiple disctionary options support
Diffstat (limited to 'accel-pppd/radius/radius.c')
-rw-r--r--accel-pppd/radius/radius.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c
index 82ac979d..048f7362 100644
--- a/accel-pppd/radius/radius.c
+++ b/accel-pppd/radius/radius.c
@@ -567,20 +567,26 @@ static int load_config(void)
static void radius_init(void)
{
- char *opt;
- char *dict = DICTIONARY;
+ const char *dict = NULL;
+ struct conf_sect_t *s = conf_get_section("radius");
+ struct conf_option_t *opt1;
rpd_pool = mempool_create(sizeof(struct radius_pd_t));
if (load_config())
_exit(EXIT_FAILURE);
- opt = conf_get_opt("radius", "dictionary");
- if (opt)
- dict = opt;
+
+ list_for_each_entry(opt1, &s->items, entry) {
+ if (strcmp(opt1->name, "dictionary") || !opt1->val)
+ continue;
+ dict = opt1->val;
+ if (rad_dict_load(dict))
+ _exit(0);
+ }
- if (rad_dict_load(dict))
- _exit(EXIT_FAILURE);
+ if (!dict && rad_dict_load(DICTIONARY))
+ _exit(0);
pwdb_register(&pwdb);
ipdb_register(&ipdb);