>From e2fefd695ffce51e111666fb7bf5a654fdf65f55 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 2 Sep 2015 15:53:34 +0200 Subject: [PATCH 5/8] KRB5: Offline operation with disabled domain https://fedorahosted.org/sssd/ticket/2637 If a subdomain is in the disabled state, switch krb5_child operation into offline mode. Similarly, instead of marking the whole back end as offline, mark just the domain as offline -- depending on the domain type, this would mark the whole back end or just inactivate subdomain. --- src/providers/krb5/krb5_auth.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c index d35df13994a3e16feff90592bec16d7a8f30b70a..e3e9601b356efd72e50ab86e8b7cdd048e4e70d4 100644 --- a/src/providers/krb5/krb5_auth.c +++ b/src/providers/krb5/krb5_auth.c @@ -720,7 +720,7 @@ static void krb5_auth_resolve_done(struct tevent_req *subreq) * was found good, setting offline, * but we still have to call the child to setup * the ccache file if we are performing auth */ - be_mark_offline(state->be_ctx); + be_mark_dom_offline(state->domain, state->be_ctx); kr->is_offline = true; if (kr->pd->cmd == SSS_PAM_CHAUTHTOK || @@ -754,9 +754,19 @@ static void krb5_auth_resolve_done(struct tevent_req *subreq) kr->is_offline = be_is_offline(state->be_ctx); } + if (!kr->is_offline + && sss_domain_get_state(state->domain) == DOM_INACTIVE) { + DEBUG(SSSDBG_TRACE_INTERNAL, + "Subdomain %s is inactive, will proceed offline\n", + state->domain->name); + kr->is_offline = true; + } + if (kr->is_offline && sss_krb5_realm_has_proxy(dp_opt_get_cstring(kr->krb5_ctx->opts, KRB5_REALM))) { + DEBUG(SSSDBG_TRACE_FUNC, + "Resetting offline status, KDC proxy is in use\n"); kr->is_offline = false; } -- 2.4.3