A DynamicLookupCommand exiting with 10 is treated like an empty server stanza.
authorLinus Nordberg <linus@nordu.net>
Sat, 8 Oct 2011 13:54:33 +0000 (15:54 +0200)
committerLinus Nordberg <linus@nordu.net>
Sat, 8 Oct 2011 13:54:33 +0000 (15:54 +0200)
This way a script can signal "not found".

The naptr-eduroam.sh and radsec-dynsrv.sh scripts are changed to
behave like this.

Closes RADSECPROXY-22.

radsecproxy.c
tools/naptr-eduroam.sh
tools/radsec-dynsrv.sh

index 6554e8d..303aba4 100644 (file)
@@ -2273,8 +2273,14 @@ int dynamicconfig(struct server *server) {
     }
 
     if (status) {
-       debug(DBG_INFO, "dynamicconfig: command exited with status %d", WEXITSTATUS(status));
-       goto errexit;
+       if (WEXITSTATUS(status) == 10) {
+           debug(DBG_INFO, "dynamicconfig: command signals empty config");
+       }
+       else {
+           debug(DBG_INFO, "dynamicconfig: command exited with status %d",
+                 WEXITSTATUS(status));
+           goto errexit;
+       }
     }
 
     if (ok)
index be722c9..4aa3c4b 100755 (executable)
@@ -70,4 +70,4 @@ if [ -n "${SERVERS}" ]; then
     exit 0
 fi
 
-exit 0
+exit 10                                # No server found.
index 7a74b6d..4b9cb3e 100755 (executable)
@@ -48,4 +48,4 @@ if test -n "${SERVERS}" ; then
         exit 0
 fi
 
-exit 0
+exit 10                                # No server found.