Commit 82b55cc0 authored by venaas's avatar venaas Committed by venaas

checking exit code from dynsrvlookup

git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@272 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent 990387e1
#! /bin/sh #! /bin/sh
srv=`host -t srv _radsec._tcp.$1` srv=`host -t srv _radsec._tcp.$1`
# should do exit 1 or something if host command fails
host=`echo $srv|cut -d\ -f8` host=`echo $srv|cut -d\ -f8`
port=`echo $srv|cut -d\ -f7` port=`echo $srv|cut -d\ -f7`
echo "server $1-$host {" echo "server $1-$host {"
......
...@@ -2901,7 +2901,7 @@ void adddynamicrealmserver(struct realm *realm, struct clsrvconf *conf, char *id ...@@ -2901,7 +2901,7 @@ void adddynamicrealmserver(struct realm *realm, struct clsrvconf *conf, char *id
} }
void dynamicconfig(struct server *server) { void dynamicconfig(struct server *server) {
int ok, fd[2]; int ok, fd[2], status;
pid_t pid; pid_t pid;
struct clsrvconf *conf = server->conf; struct clsrvconf *conf = server->conf;
struct gconffile *cf = NULL; struct gconffile *cf = NULL;
...@@ -2937,10 +2937,15 @@ void dynamicconfig(struct server *server) { ...@@ -2937,10 +2937,15 @@ void dynamicconfig(struct server *server) {
); );
freegconf(&cf); freegconf(&cf);
if (waitpid(pid, NULL, 0) < 0) { if (waitpid(pid, &status, 0) < 0) {
debug(DBG_ERR, "dynamicconfig: wait error"); debug(DBG_ERR, "dynamicconfig: wait error");
goto errexit; goto errexit;
} }
if (status) {
debug(DBG_INFO, "dynamicconfig: command exited with status %d", WEXITSTATUS(status));
goto errexit;
}
if (ok) if (ok)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment