]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use async bind for eDir bind during authorization
authorNick Porter <nick@portercomputing.co.uk>
Fri, 21 Apr 2023 12:45:38 +0000 (13:45 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 4 May 2023 14:27:23 +0000 (15:27 +0100)
src/modules/rlm_ldap/rlm_ldap.c

index fc98ef9c5ad3cc837a921afc6fa88af4b78980e3..029bf2a176b4ba1b58938525dd560d064ff8becc 100644 (file)
@@ -1332,18 +1332,26 @@ static unlang_action_t mod_authorize_resume(rlm_rcode_t *p_result, UNUSED int *p
                        /*
                         *      Bind as the user
                         */
+                       REPEAT_MOD_AUTHORIZE_RESUME;
                        if (fr_ldap_bind_auth_async(request, thread, autz_ctx->dn, password->vp_strvalue) < 0) {
                                rcode = RLM_MODULE_FAIL;
                                goto finish;
                        }
-
-                       rcode = unlang_interpret_synchronous(unlang_interpret_event_list(request), request);
-
-                       if (rcode != RLM_MODULE_OK) goto finish;
+                       autz_ctx->status = LDAP_AUTZ_POST_EDIR;
+                       return UNLANG_ACTION_PUSHED_CHILD;
                }
-               FALL_THROUGH;
+               goto skip_edir;
 
        case LDAP_AUTZ_POST_EDIR:
+               /*
+                *      The result of the eDirectory user bind will be in p_result.
+                *      Anything other than RLM_MODULE_OK is a failure.
+                */
+               if (*p_result != RLM_MODULE_OK) {
+                       rcode = *p_result;
+                       goto finish;
+               }
+
        skip_edir:
 #endif
                /*