]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't check for STOP in modules, and check top-most parent
authorAlan T. DeKok <aland@freeradius.org>
Mon, 28 Aug 2017 13:14:55 +0000 (09:14 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 29 Aug 2017 11:38:45 +0000 (07:38 -0400)
src/main/unlang_interpret.c

index 2e7bccc1484ca05790294600c8d6ef403843ebb1..927a449c529784ebe37aa4cca883df61eb8d30df 100644 (file)
@@ -1141,11 +1141,6 @@ static unlang_action_t unlang_module_call(REQUEST *request, unlang_stack_t *stac
        sp = unlang_generic_to_module_call(instruction);
        rad_assert(sp);
 
-       /*
-        *      If the request should stop, refuse to do anything.
-        */
-       if (request->master_state == REQUEST_STOP_PROCESSING) return UNLANG_ACTION_STOP_PROCESSING;
-
        RDEBUG4("[%i] %s - %s (%s)", stack->depth, __FUNCTION__,
                sp->module_instance->name, sp->module_instance->module->name);
 
@@ -1486,6 +1481,8 @@ start_subsection:
         *      Loop over all modules in this list.
         */
        while (frame->instruction != NULL) {
+               REQUEST *parent;
+
 resume_subsection:
                instruction = frame->instruction;
 
@@ -1495,12 +1492,18 @@ resume_subsection:
 
                VERIFY_REQUEST(request);
 
+               /*
+                *      We may be multiple layers deep in fork{} or
+                *      parallel{}.  Only the top-level request is
+                *      tracked && marked "stop processing".
+                */
+               parent = request;
+               while (parent->parent) parent = parent->parent;
+
                /*
                 *      We've been asked to stop.  Do so.
                 */
-               if ((request->master_state == REQUEST_STOP_PROCESSING) ||
-                   (request->parent &&
-                    (request->parent->master_state == REQUEST_STOP_PROCESSING))) {
+               if (parent->master_state == REQUEST_STOP_PROCESSING) {
                do_stop:
                        frame->result = RLM_MODULE_FAIL;
                        frame->priority = 9999;