summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2015-12-14 14:16:10 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2015-12-15 16:27:49 +0100
commit6b83f562fbd67cf61a7167c6057764fd08146241 (patch)
tree4a61949be51f2509bf24e0c0a3ae7bbcc5335f55
parent15ebeedaad83cc5dcf896cfcdea850227fdc46b5 (diff)
downloadsssd-6b83f562fbd67cf61a7167c6057764fd08146241.tar.gz
sssd-6b83f562fbd67cf61a7167c6057764fd08146241.tar.xz
sssd-6b83f562fbd67cf61a7167c6057764fd08146241.zip
SUDO: get srv_opts after we are connected
It may be NULL in _send if SSSD has not been connected to LDAP so far. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
-rw-r--r--src/providers/ldap/sdap_async_sudo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c
index bd19de123..fd9aecba9 100644
--- a/src/providers/ldap/sdap_async_sudo.c
+++ b/src/providers/ldap/sdap_async_sudo.c
@@ -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;
@@ -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,