summaryrefslogtreecommitdiff
path: root/server/providers/ldap
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-10-24 13:36:34 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-27 10:42:12 -0400
commit3a21103f61bf9b60256cc2d0da54b757b634319f (patch)
treec958e19a991e8d6b9c6e3dbe0cc4f62e4ad425b2 /server/providers/ldap
parentee633d9fe3b48a88387edab7978bb16422525d21 (diff)
downloadsssd-3a21103f61bf9b60256cc2d0da54b757b634319f.tar.gz
sssd-3a21103f61bf9b60256cc2d0da54b757b634319f.tar.bz2
sssd-3a21103f61bf9b60256cc2d0da54b757b634319f.zip
Move responsibility for entry expiration timeout
The providers are now responsible for determining how long a cached entry is considered valid. The default is the same as before (600s)
Diffstat (limited to 'server/providers/ldap')
-rw-r--r--server/providers/ldap/ldap_common.c2
-rw-r--r--server/providers/ldap/sdap.h2
-rw-r--r--server/providers/ldap/sdap_async.c12
3 files changed, 11 insertions, 5 deletions
diff --git a/server/providers/ldap/ldap_common.c b/server/providers/ldap/ldap_common.c
index bb836c1e..beb48a41 100644
--- a/server/providers/ldap/ldap_common.c
+++ b/server/providers/ldap/ldap_common.c
@@ -43,7 +43,7 @@ struct dp_option default_basic_opts[] = {
{ "ldap_offline_timeout", DP_OPT_NUMBER, { .number = 60 }, NULL_NUMBER },
{ "ldap_force_upper_case_realm", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
{ "ldap_enumeration_refresh_timeout", DP_OPT_NUMBER, { .number = 300 }, NULL_NUMBER },
- { "ldap_stale_time", DP_OPT_NUMBER, { .number = 1800 }, NULL_NUMBER },
+ { "entry_cache_timoeut", DP_OPT_NUMBER, { .number = 1800 }, NULL_NUMBER },
{ "ldap_tls_cacert", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_tls_cacertdir", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_id_use_start_tls", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
diff --git a/server/providers/ldap/sdap.h b/server/providers/ldap/sdap.h
index 3768015b..8ae9d038 100644
--- a/server/providers/ldap/sdap.h
+++ b/server/providers/ldap/sdap.h
@@ -106,7 +106,7 @@ enum sdap_basic_opt {
SDAP_OFFLINE_TIMEOUT,
SDAP_FORCE_UPPER_CASE_REALM,
SDAP_ENUM_REFRESH_TIMEOUT,
- SDAP_STALE_TIME,
+ SDAP_ENTRY_CACHE_TIMEOUT,
SDAP_TLS_CACERT,
SDAP_TLS_CACERTDIR,
SDAP_ID_TLS,
diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c
index 140f3fae..28e4fa4f 100644
--- a/server/providers/ldap/sdap_async.c
+++ b/server/providers/ldap/sdap_async.c
@@ -1509,7 +1509,9 @@ static struct tevent_req *sdap_save_user_send(TALLOC_CTX *memctx,
subreq = sysdb_store_user_send(state, state->ev, state->handle,
state->dom, state->name, pwd,
uid, gid, gecos, homedir, shell,
- user_attrs);
+ user_attrs,
+ dp_opt_get_int(opts->basic,
+ SDAP_ENTRY_CACHE_TIMEOUT));
if (!subreq) {
ret = ENOMEM;
goto fail;
@@ -1933,7 +1935,9 @@ static struct tevent_req *sdap_set_grpmem_send(TALLOC_CTX *memctx,
subreq = sysdb_store_group_send(memctx, ev, handle, dom,
gm->name, 0,
- member_users, member_groups, NULL);
+ member_users, member_groups, NULL,
+ dp_opt_get_int(opts->basic,
+ SDAP_ENTRY_CACHE_TIMEOUT));
/* steal members on subreq,
* so they are freed when the request is finished */
@@ -2132,7 +2136,9 @@ static struct tevent_req *sdap_save_group_send(TALLOC_CTX *memctx,
state->handle, state->dom,
state->name, gid,
member_users, member_groups,
- group_attrs);
+ group_attrs,
+ dp_opt_get_int(opts->basic,
+ SDAP_ENTRY_CACHE_TIMEOUT));
if (!subreq) {
ret = ENOMEM;
goto fail;