From 15f3e53e7ab9285afbebc8e2ec4d6d4577fef3da Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Wed, 18 May 2016 13:03:05 +0200 Subject: sdap_search_bases: allow map to be NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In some cases we do not want any attribute translations. Reviewed-by: Sumit Bose Reviewed-by: Jakub Hrozek Reviewed-by: Lukáš Slebodník --- src/providers/ldap/sdap_ops.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/providers/ldap/sdap_ops.c b/src/providers/ldap/sdap_ops.c index b2f2c35d0..ad4b0cf6d 100644 --- a/src/providers/ldap/sdap_ops.c +++ b/src/providers/ldap/sdap_ops.c @@ -74,12 +74,6 @@ struct tevent_req *sdap_search_bases_send(TALLOC_CTX *mem_ctx, goto immediately; } - if (map == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, "No attribute map specified!\n"); - ret = ERR_INTERNAL; - goto immediately; - } - state->ev = ev; state->opts = opts; state->sh = sh; @@ -93,10 +87,14 @@ struct tevent_req *sdap_search_bases_send(TALLOC_CTX *mem_ctx, ? dp_opt_get_int(opts->basic, SDAP_SEARCH_TIMEOUT) : timeout; - for (state->map_num_attrs = 0; - state->map[state->map_num_attrs].opt_name != NULL; - state->map_num_attrs++) { - /* no op */; + if (state->map != NULL) { + for (state->map_num_attrs = 0; + state->map[state->map_num_attrs].opt_name != NULL; + state->map_num_attrs++) { + /* no op */; + } + } else { + state->map_num_attrs = 0; } if (state->attrs == NULL) { -- cgit