From e38e6c92bf7be07aa571670a33d4e2ff3dd5fd2c Mon Sep 17 00:00:00 2001 From: venaas Date: Mon, 2 Jun 2008 13:28:19 +0000 Subject: cleaned up the initial dynamic server discovery code a bit git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@270 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- radsecproxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radsecproxy.c b/radsecproxy.c index e430054..07811ec 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -40,6 +40,7 @@ #endif #include #include +#include #include #include #include @@ -2827,7 +2828,8 @@ struct realm *addrealm(struct list *realmlist, char *value, char **servers, char void adddynamicrealmserver(struct realm *realm, struct clsrvconf *conf, char *id) { struct clsrvconf *srvconf; struct realm *newrealm = NULL; - char *realmname; + char *realmname, *s; + if (!conf->dynamiclookupcommand) return; @@ -2839,6 +2841,9 @@ void adddynamicrealmserver(struct realm *realm, struct clsrvconf *conf, char *id realmname++; if (!*realmname) return; + for (s = realmname; *s; s++) + if (*s != '-' && !isalnum(*s)) + return; pthread_mutex_lock(&realm->subrealms_mutex); /* exit if we now already got a matching subrealm */ -- cgit v1.1