summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_connection.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-12-08 16:14:52 -0500
committerStephen Gallagher <sgallagh@redhat.com>2011-12-12 07:46:09 -0500
commit440d7fb430f83b3547f98f79c67a232ab2220296 (patch)
treefeff673f8b84c41776cae7800b3f2f7dbabf4d5b /src/providers/ldap/sdap_async_connection.c
parent57170bd05e64559a604c1907c59728e8d9e83cd4 (diff)
downloadsssd-440d7fb430f83b3547f98f79c67a232ab2220296.tar.gz
sssd-440d7fb430f83b3547f98f79c67a232ab2220296.tar.xz
sssd-440d7fb430f83b3547f98f79c67a232ab2220296.zip
Add sdap_connection_expire_timeout option
https://fedorahosted.org/sssd/ticket/1036
Diffstat (limited to 'src/providers/ldap/sdap_async_connection.c')
-rw-r--r--src/providers/ldap/sdap_async_connection.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 6350e337e..e1099a17d 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -1502,6 +1502,8 @@ static void sdap_cli_auth_step(struct tevent_req *req)
struct sdap_cli_connect_state *state = tevent_req_data(req,
struct sdap_cli_connect_state);
struct tevent_req *subreq;
+ time_t now;
+ int expire_timeout;
if (!state->do_auth) {
/* No authentication requested or GSSAPI auth forced off */
@@ -1509,6 +1511,16 @@ static void sdap_cli_auth_step(struct tevent_req *req)
return;
}
+ /* Set the LDAP expiration time
+ * If SASL has already set it, use the sooner of the two
+ */
+ now = time(NULL);
+ expire_timeout = dp_opt_get_int(state->opts->basic, SDAP_EXPIRE_TIMEOUT);
+ if (!state->sh->expire_time
+ || (state->sh->expire_time > (now + expire_timeout))) {
+ state->sh->expire_time = now + expire_timeout;
+ }
+
subreq = sdap_auth_send(state,
state->ev,
state->sh,