int fr_ldap_map_verify(map_t *map, void *instance);
int fr_ldap_map_expand(TALLOC_CTX *ctx, fr_ldap_map_exp_t *expanded, request_t *request,
- map_list_t const *maps, char const *generic_attr, char const *check_attr);
+ map_list_t const *maps, char const *generic_attr, char const *check_attr,
+ char const *fallthrough_attr);
int fr_ldap_map_do(request_t *request, char const *check_attr,
char const *valuepair_attr, fr_ldap_map_exp_t const *expanded, LDAPMessage *entry);
* @param[in] maps to expand.
* @param[in] generic_attr name to append to the attribute list.
* @param[in] check_attr name to append to the attribute list.
+ * @param[in] fallthrough_attr name to append to the attribute list.
* @return
* - 0 on success.
* - -1 on failure.
*/
int fr_ldap_map_expand(TALLOC_CTX *ctx, fr_ldap_map_exp_t *expanded, request_t *request, map_list_t const *maps,
- char const *generic_attr, char const *check_attr)
+ char const *generic_attr, char const *check_attr, char const *fallthrough_attr)
{
map_t const *map = NULL;
unsigned int total = 0;
if (generic_attr) expanded->attrs[total++] = generic_attr;
if (check_attr) expanded->attrs[total++] = check_attr;
+ if (fallthrough_attr) expanded->attrs[total++] = fallthrough_attr;
expanded->attrs[total] = NULL;
expanded->count = total;
* Synchronous expansion of maps (fixme!)
*/
if (fr_ldap_map_expand(xlat_ctx, &xlat_ctx->expanded, request, env_data->profile_map,
- inst->valuepair_attr, inst->profile.check_attr) < 0) goto error;
+ inst->valuepair_attr, inst->profile.check_attr, inst->profile.fallthrough_attr) < 0) goto error;
ttrunk = fr_thread_ldap_trunk_get(t, host_url, handle_config->admin_identity,
handle_config->admin_password, request, handle_config);
if (host) ldap_memfree(host);
/*
* Expand the RHS of the maps to get the name of the attributes.
*/
- if (fr_ldap_map_expand(map_ctx, &map_ctx->expanded, request, maps, NULL, NULL) < 0) goto fail;
+ if (fr_ldap_map_expand(map_ctx, &map_ctx->expanded, request, maps, NULL, NULL, NULL) < 0) goto fail;
/*
* If the URL is <scheme>:/// the parsed host will be NULL - use config default
* User-Password here. LDAP authorization can be used
* for many things besides searching for users.
*/
- if (fr_ldap_map_expand(autz_ctx, expanded, request, call_env->user_map, inst->valuepair_attr, NULL) < 0) {
+ if (fr_ldap_map_expand(autz_ctx, expanded, request, call_env->user_map, inst->valuepair_attr, NULL, NULL) < 0) {
fail:
talloc_free(autz_ctx);
RETURN_MODULE_FAIL;