summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Reichl <preichl@redhat.com>2014-10-30 16:50:27 +0000
committerJakub Hrozek <jhrozek@redhat.com>2014-11-05 18:54:33 +0100
commit8d0b8a15a56f1fd12655e838cc17004d12dff8dd (patch)
tree9e471885a8fa5860888f429be07ce4c0909b5f9d
parent61b6c497901004e34f1bdf6d3c04c2943720a500 (diff)
downloadsssd-8d0b8a15a56f1fd12655e838cc17004d12dff8dd.tar.gz
sssd-8d0b8a15a56f1fd12655e838cc17004d12dff8dd.tar.xz
sssd-8d0b8a15a56f1fd12655e838cc17004d12dff8dd.zip
CONFDB: Detect&fix misconf opt refresh_expired_interval
Related to: https://fedorahosted.org/sssd/ticket/2102 Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--src/confdb/confdb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 8443fe553..c55a945a4 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -1058,6 +1058,21 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
goto done;
}
+ /* detect and fix misconfiguration */
+ if (domain->refresh_expired_interval > entry_cache_timeout) {
+ DEBUG(SSSDBG_CONF_SETTINGS,
+ "refresh_expired_interval (%d) cannot be greater then "
+ "entry_cache_timeout (%u)\n",
+ domain->refresh_expired_interval, entry_cache_timeout);
+
+ domain->refresh_expired_interval = 0.75 * entry_cache_timeout;
+
+ DEBUG(SSSDBG_CONF_SETTINGS,
+ "refresh_expired_interval is being set to recommended value "
+ "entry_cache_timeout * 0.75 (%u).\n",
+ domain->refresh_expired_interval);
+ }
+
/* Set the PAM warning time, if specified. If not specified, pass on
* the "not set" value of "-1" which means "use provider default". The
* value 0 means "always display the warning if server sends one" */