Don't treat exit 10 from dynamic scripts differently from any other non-zero code.
authorLinus Nordberg <linus@nordu.net>
Tue, 10 Apr 2012 13:55:57 +0000 (15:55 +0200)
committerLinus Nordberg <linus@nordu.net>
Thu, 12 Apr 2012 15:26:13 +0000 (17:26 +0200)
clientwr() should treat the dynamic lookup as a failure and will not
be any happier to know that the exact error was that it didn't resolv.
The script can do whatever logging is wanted.

That said, this commit also makes the scripts exit with 10 in order to
signal failure.

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

index 5248c41..d8500c1 100644 (file)
@@ -2297,14 +2297,9 @@ int dynamicconfig(struct server *server) {
     }
 
     if (status) {
-       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;
-       }
+        debug(DBG_INFO, "dynamicconfig: command exited with status %d",
+              WEXITSTATUS(status));
+        goto errexit;
     }
 
     if (ok)
index 43d3d9f..6497549 100755 (executable)
@@ -70,4 +70,4 @@ if [ -n "${SERVERS}" ]; then
     exit 0
 fi
 
-exit 0
+exit 10                                # No server found.
index 4d00f32..3150018 100755 (executable)
@@ -48,4 +48,4 @@ if test -n "${SERVERS}" ; then
         exit 0
 fi
 
-exit 0
+exit 10                                # No server found.