} \
} while (0)
-
-/** Hack to make code work with synchronous interpreter
- *
- */
-static unlang_action_t ldap_trunk_query_start(UNUSED rlm_rcode_t *p_result, UNUSED int *priority,
- UNUSED request_t *request, UNUSED void *uctx)
-{
- return UNLANG_ACTION_YIELD;
-}
-
-/** Hack to add timeouts
- *
- * Here we send a cancellation signal to the trunk if the request hits the timeout limit.
- */
-static void _ldap_search_sync_timeout(UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *uctx)
-{
- ldap_trunk_query_cancel(NULL, FR_SIGNAL_CANCEL, uctx);
-}
-
/** Run an async or sync search LDAP query on a trunk connection
*
* @param[out] p_result from synchronous evaluation.
* @param[in] attrs to be returned.
* @param[in] serverctrls specific to this query.
* @param[in] clientctrls specific to this query.
- * @param[in] is_async If true, will return UNLANG_ACTION_YIELD
- * and push a search onto the unlang stack
- * for the current request.
- * If false, will perform a synchronous search
- * and provide the result in p_result.
* @return
* - UNLANG_ACTION_FAIL on error.
* - UNLANG_ACTION_PUSHED_CHILD on success.
- * - UNLANG_ACTION_CALCULATE_RESULT if the query was run synchronously.
*/
unlang_action_t fr_ldap_trunk_search(rlm_rcode_t *p_result,
TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *base_dn, int scope, char const *filter, char const * const *attrs,
- LDAPControl **serverctrls, LDAPControl **clientctrls,
- bool is_async)
+ LDAPControl **serverctrls, LDAPControl **clientctrls)
{
unlang_action_t action;
fr_ldap_query_t *query;
return UNLANG_ACTION_FAIL;
}
- action = unlang_function_push(request, is_async ? NULL : ldap_trunk_query_start, ldap_trunk_query_results,
- ldap_trunk_query_cancel, ~FR_SIGNAL_CANCEL, is_async ? UNLANG_SUB_FRAME : UNLANG_TOP_FRAME, query);
+ action = unlang_function_push(request, NULL, ldap_trunk_query_results,
+ ldap_trunk_query_cancel, ~FR_SIGNAL_CANCEL, UNLANG_SUB_FRAME, query);
if (action == UNLANG_ACTION_FAIL) goto error;
*out = query;
- /*
- * Hack until everything is async
- */
- if (!is_async) {
- fr_event_timer_t const *ev = NULL;
-
- fr_time_delta_t timeout = ttrunk->config.res_timeout;
-
- /*
- * Add an event that'll send a cancellation request
- * to the request.
- */
- if (fr_time_delta_ispos(timeout)) {
- if (fr_event_timer_in(ctx, unlang_interpret_event_list(request), &ev, timeout,
- _ldap_search_sync_timeout, query) < 0) goto error;
- }
-
- *p_result = unlang_interpret_synchronous(unlang_interpret_event_list(request), request);
-
- talloc_const_free(ev); /* If the timer fired this should be NULL */
-
- return UNLANG_ACTION_CALCULATE_RESULT;
- }
-
return UNLANG_ACTION_PUSHED_CHILD;
}
TALLOC_CTX *ctx,
fr_ldap_query_t **out, request_t *request, fr_ldap_thread_trunk_t *ttrunk,
char const *base_dn, int scope, char const *filter, char const * const *attrs,
- LDAPControl **serverctrls, LDAPControl **clientctrls,
- bool is_async);
+ LDAPControl **serverctrls, LDAPControl **clientctrls);
unlang_action_t fr_ldap_trunk_modify(rlm_rcode_t *p_result,
TALLOC_CTX *ctx,
return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, group_ctx->ttrunk,
group_ctx->base_dn->vb_strvalue, inst->groupobj_scope, filter,
- null_attrs, NULL, NULL, true);
+ null_attrs, NULL, NULL);
}
/** Process the results of looking up group DNs from names
RDEBUG2("Resolving group DN \"%s\" to group name", *group_ctx->dn);
return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, group_ctx->ttrunk, *group_ctx->dn,
- LDAP_SCOPE_BASE, NULL, group_ctx->attrs, NULL, NULL, true);
+ LDAP_SCOPE_BASE, NULL, group_ctx->attrs, NULL, NULL);
}
/** Process the results of a group DN -> name lookup.
group_ctx->attrs[0] = inst->groupobj_name_attr;
return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, group_ctx->ttrunk,
group_ctx->base_dn->vb_strvalue, inst->groupobj_scope,
- group_ctx->filter, group_ctx->attrs, NULL, NULL, true);
-
+ group_ctx->filter, group_ctx->attrs, NULL, NULL);
}
/** Cancel a pending group object lookup.
return fr_ldap_trunk_search(p_result, group_ctx, &group_ctx->query, request, xlat_ctx->ttrunk,
group_ctx->lookup_dn, LDAP_SCOPE_BASE, NULL, group_ctx->attrs,
- NULL, NULL, true);
+ NULL, NULL);
}
/** Cancel an in-progress DN to name lookup.
ldap_memberof_xlat_ctx_t *xlat_ctx = talloc_get_type_abort(group_ctx->xlat_ctx, ldap_memberof_xlat_ctx_t);
return fr_ldap_trunk_search(p_result, xlat_ctx, &xlat_ctx->query, request, xlat_ctx->ttrunk, xlat_ctx->dn,
- LDAP_SCOPE_BASE, NULL, xlat_ctx->attrs, NULL, NULL, true);
+ LDAP_SCOPE_BASE, NULL, xlat_ctx->attrs, NULL, NULL);
}
/** Process the results of evaluating a user object when checking group membership
return fr_ldap_trunk_search(&rcode, map_ctx, &map_ctx->query, request, ttrunk, ldap_url->lud_dn,
ldap_url->lud_scope, ldap_url->lud_filter, map_ctx->expanded.attrs,
- NULL, NULL, true);
+ NULL, NULL);
}
/** Perform async lookup of user DN if required for authentication
return fr_ldap_trunk_search(&ret, profile_ctx, &profile_ctx->query, request, ttrunk, dn,
LDAP_SCOPE_BASE, autz_ctx->call_env->profile_filter.vb_strvalue,
- expanded->attrs, NULL, NULL, true);
+ expanded->attrs, NULL, NULL);
}
/** Start LDAP authorization with async lookup of user DN
return fr_ldap_trunk_search(NULL, user_ctx, &user_ctx->query, request, user_ctx->ttrunk,
user_ctx->base_dn, user_ctx->inst->userobj_scope, user_ctx->filter,
- user_ctx->attrs, serverctrls, NULL, true);
+ user_ctx->attrs, serverctrls, NULL);
}
/** Check for presence of access attribute in result