diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-21 13:18:47 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-23 09:24:49 +0200 |
commit | c40b2e130b559caf90cf737977edba1f5703efc9 (patch) | |
tree | 449b4e3dc712b082a50e417d091ef32ffca3d07a | |
parent | d382b037398d8040045ec16fdd123fc5125dcb21 (diff) | |
download | sssd-c40b2e130b559caf90cf737977edba1f5703efc9.tar.gz sssd-c40b2e130b559caf90cf737977edba1f5703efc9.tar.xz sssd-c40b2e130b559caf90cf737977edba1f5703efc9.zip |
LDAP: Save connection time from LDAP provider
Whenever a connection request ends successfully, store the success time
to the sdap_id_conn_ctx.
-rw-r--r-- | src/providers/ldap/ldap_common.h | 2 | ||||
-rw-r--r-- | src/providers/ldap/sdap_id_op.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h index f552520a0..2e060f0ba 100644 --- a/src/providers/ldap/ldap_common.h +++ b/src/providers/ldap/ldap_common.h @@ -57,6 +57,8 @@ struct sdap_id_conn_ctx { struct sdap_id_conn_ctx *prev, *next; /* do not go offline, try another connection */ bool ignore_mark_offline; + /* time of last successfull connection */ + time_t conn_time; }; struct sdap_id_ctx { diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c index 0474a9cb7..6d8cdc384 100644 --- a/src/providers/ldap/sdap_id_op.c +++ b/src/providers/ldap/sdap_id_op.c @@ -773,6 +773,7 @@ static void sdap_id_op_connect_req_complete(struct sdap_id_op *op, int dp_error, state->result = ret; if (ret == EOK) { + op->conn_data->conn_cache->id_conn->conn_time = time(NULL); tevent_req_done(req); } else { sdap_id_op_hook_conn_data(op, NULL); |