summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2009-01-08 08:15:15 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2009-01-08 08:15:15 +0000
commit7aab13c06ae189b2342d7a98f2dade0c22078329 (patch)
tree7a4577bcd6d5c5610e80ba364b27165844e398c4
parent6f3af9861a7eab73df328b6946edd86fdc3b7693 (diff)
fixed bug with dynamicserver and default secret
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@454 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c26
1 files changed, 13 insertions, 13 deletions
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;