From 7aab13c06ae189b2342d7a98f2dade0c22078329 Mon Sep 17 00:00:00 2001 From: venaas Date: Thu, 8 Jan 2009 08:15:15 +0000 Subject: fixed bug with dynamicserver and default secret git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@454 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- radsecproxy.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'radsecproxy.c') diff --git a/radsecproxy.c b/radsecproxy.c index f1bcee5..325acbf 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -2843,18 +2843,6 @@ int compileserverconfig(struct clsrvconf *conf, const char *block) { if (conf->confrewriteout) conf->rewriteout = getrewrite(conf->confrewriteout, NULL); - if (!conf->secret) { - if (!conf->pdef->secretdefault) { - debug(DBG_ERR, "error in block %s, secret must be specified for transport type %s", block, conf->pdef->name); - return 0; - } - conf->secret = stringcopy(conf->pdef->secretdefault, 0); - if (!conf->secret) { - debug(DBG_ERR, "malloc failed"); - return 0; - } - } - if (!conf->dynamiclookupcommand && !resolvepeer(conf, 0)) { debug(DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)"); return 0; @@ -2979,9 +2967,21 @@ int confserver_cb(struct gconffile **cf, void *arg, char *block, char *opt, char goto errexit; } + if (!conf->secret) { + if (!conf->pdef->secretdefault) { + debug(DBG_ERR, "error in block %s, secret must be specified for transport type %s", block, conf->pdef->name); + return 0; + } + conf->secret = stringcopy(conf->pdef->secretdefault, 0); + if (!conf->secret) { + debug(DBG_ERR, "malloc failed"); + return 0; + } + } + if (resconf) return 1; - + if (!list_push(srvconfs, conf)) { debug(DBG_ERR, "malloc failed"); goto errexit; -- cgit v1.2.3