diff options
author | Pavel Březina <pbrezina@redhat.com> | 2016-05-18 13:03:05 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-06-20 14:48:46 +0200 |
commit | 15f3e53e7ab9285afbebc8e2ec4d6d4577fef3da (patch) | |
tree | 2504c4504e0383c0bd9e71e39d607aaf110f0016 | |
parent | dee7a89098b698e756f63e4041734d7322ad8b1e (diff) | |
download | sssd-15f3e53e7ab9285afbebc8e2ec4d6d4577fef3da.tar.gz sssd-15f3e53e7ab9285afbebc8e2ec4d6d4577fef3da.tar.xz sssd-15f3e53e7ab9285afbebc8e2ec4d6d4577fef3da.zip |
sdap_search_bases: allow map to be NULL
In some cases we do not want any attribute translations.
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
-rw-r--r-- | src/providers/ldap/sdap_ops.c | 18 |
1 files changed, 8 insertions, 10 deletions
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) { |