Skip to content

Commit

Permalink
SUDO: get srv_opts after we are connected
Browse files Browse the repository at this point in the history
It may be NULL in _send if SSSD has not been connected to LDAP so far.

Reviewed-by: Lukáš Slebodník <[email protected]>
(cherry picked from commit 6b83f56)
  • Loading branch information
pbrezina authored and Lukas Slebodnik committed Dec 15, 2015
1 parent 7435446 commit 76170b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/ldap/sdap_async_sudo.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ struct tevent_req *sdap_sudo_refresh_send(TALLOC_CTX *mem_ctx,

state->sudo_ctx = sudo_ctx;
state->ev = id_ctx->be->ev;
state->srv_opts = id_ctx->srv_opts;
state->opts = id_ctx->opts;
state->domain = id_ctx->be->domain;
state->sysdb = id_ctx->be->domain->sysdb;
Expand Down Expand Up @@ -609,6 +608,9 @@ static void sdap_sudo_refresh_connect_done(struct tevent_req *subreq)

DEBUG(SSSDBG_TRACE_FUNC, "SUDO LDAP connection successful\n");

/* Obtain srv_opts here in case of first connection. */
state->srv_opts = state->sudo_ctx->id_ctx->srv_opts;

/* Renew host information if needed. */
if (state->sudo_ctx->run_hostinfo) {
subreq = sdap_sudo_get_hostinfo_send(state, state->opts,
Expand Down

0 comments on commit 76170b9

Please sign in to comment.