MEM(parsed = call_env_parsed_add(ctx, out,
&(call_env_parser_t){ FR_CALL_ENV_PARSE_ONLY_OFFSET("update", FR_TYPE_VOID, 0, cache_call_env_t, maps)}));
- MEM(maps = talloc_zero(parsed, map_list_t));
+ MEM(maps = talloc(parsed, map_list_t));
map_list_init(maps);
+
if (map_afrom_cs(maps, maps, update,
&parse_rules, &parse_rules, cache_verify, NULL, MAX_ATTRMAP) < 0) {
error:
XLAT_ARG_PARSER_TERMINATOR
};
+static inline CC_HINT(always_inline)
+bool ldap_map_list_empty(map_list_t *maps)
+{
+ if (!maps) return true;
+
+ return map_list_empty(maps);
+}
+
/** Escape LDAP string
*
* @ingroup xlat_functions
/*
* Synchronous expansion of maps (fixme!)
*/
- if (fr_ldap_map_expand(xlat_ctx, &xlat_ctx->expanded, request, env_data->profile_map, inst->valuepair_attr) < 0) goto error;
+ if (!ldap_map_list_empty(env_data->profile_map) &&
+ (fr_ldap_map_expand(xlat_ctx, &xlat_ctx->expanded, request, env_data->profile_map, inst->valuepair_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);
FALL_THROUGH;
case LDAP_AUTZ_MAP:
- if (!map_list_empty(call_env->user_map) || inst->valuepair_attr) {
+ if (!ldap_map_list_empty(call_env->user_map) || inst->valuepair_attr) {
RDEBUG2("Processing user attributes");
RINDENT();
if (fr_ldap_map_do(request, inst->valuepair_attr,
* 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) < 0) {
+ if (!ldap_map_list_empty(call_env->user_map) &&
+ (fr_ldap_map_expand(autz_ctx, expanded, request, call_env->user_map, inst->valuepair_attr) < 0)) {
fail:
talloc_free(autz_ctx);
RETURN_MODULE_FAIL;
}
}
}));
- MEM(maps = talloc_zero(parsed, map_list_t));
+
+ MEM(maps = talloc(parsed, map_list_t));
+ map_list_init(maps);
if (map_afrom_cs(maps, maps, update, &parse_rules, &parse_rules, fr_ldap_map_verify, NULL, LDAP_MAX_ATTRMAP) < 0) {
call_env_parsed_free(out, parsed);
break;
}
}
+ call_env_parsed_set_data(parsed, maps);
}
/*