From fc7ec12f1b851bab1eedf3ecdcb094ea80b46dd2 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Mon, 19 Apr 2010 11:59:09 +0200 Subject: Add support for delayed kinit if offline If the configuration option krb5_store_password_if_offline is set to true and the backend is offline the plain text user password is stored and used to request a TGT if the backend becomes online. If available the Linux kernel key retention service is used. --- src/db/sysdb_ops.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/db/sysdb_ops.c') diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 618b81086..6fcc95b19 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -4645,6 +4645,7 @@ struct sysdb_cache_auth_state { struct sss_domain_info *domain; struct sysdb_ctx *sysdb; struct confdb_ctx *cdb; + bool just_check; struct sysdb_attrs *update_attrs; bool authentication_successful; struct sysdb_handle *handle; @@ -4724,7 +4725,8 @@ struct tevent_req *sysdb_cache_auth_send(TALLOC_CTX *mem_ctx, const char *name, const uint8_t *authtok, size_t authtok_size, - struct confdb_ctx *cdb) + struct confdb_ctx *cdb, + bool just_check) { struct tevent_req *req; struct tevent_req *subreq; @@ -4774,6 +4776,7 @@ struct tevent_req *sysdb_cache_auth_send(TALLOC_CTX *mem_ctx, state->domain = domain; state->sysdb = sysdb; state->cdb = cdb; + state->just_check = just_check; state->update_attrs = NULL; state->authentication_successful = false; state->handle = NULL; @@ -4888,6 +4891,11 @@ static void sysdb_cache_auth_get_attrs_done(struct tevent_req *subreq) DEBUG(4, ("Hashes do match!\n")); state->authentication_successful = true; + if (state->just_check) { + ret = EOK; + goto done; + } + ret = sysdb_attrs_add_time_t(state->update_attrs, SYSDB_LAST_LOGIN, time(NULL)); if (ret != EOK) { -- cgit