diff --git a/authd/provider.c b/authd/provider.c index dd63d6a85..434751703 100644 --- a/authd/provider.c +++ b/authd/provider.c @@ -389,3 +389,17 @@ set_provider_data(struct auth_client *auth, uint32_t id, void *data) auth->data[(size_t)id] = data; } +void +set_provider_timeout_relative(struct auth_client *auth, uint32_t id, time_t timeout) +{ + lrb_assert(id < rb_dlink_list_length(&auth_providers)); + auth->timeout[(size_t)id] = timeout + rb_current_time(); +} + +void +set_provider_timeout_absolute(struct auth_client *auth, uint32_t id, time_t timeout) +{ + lrb_assert(id < rb_dlink_list_length(&auth_providers)); + auth->timeout[(size_t)id] = timeout; +} + diff --git a/authd/provider.h b/authd/provider.h index fdf1211e2..8e9a78636 100644 --- a/authd/provider.h +++ b/authd/provider.h @@ -117,6 +117,8 @@ void handle_cancel_connection(int parc, char *parv[]); void *get_provider_data(struct auth_client *auth, uint32_t id); void set_provider_data(struct auth_client *auth, uint32_t id, void *data); +void set_provider_timeout_relative(struct auth_client *auth, uint32_t id, time_t timeout); +void set_provider_timeout_absolute(struct auth_client *auth, uint32_t id, time_t timeout); /* Provider is operating on this auth_client (set this if you have async work to do) */ static inline void