dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0052-CONFDB-Detect-fix-misconf-opt-refresh_expired_interv.patch

905b4d
From 8d0b8a15a56f1fd12655e838cc17004d12dff8dd Mon Sep 17 00:00:00 2001
905b4d
From: Pavel Reichl <preichl@redhat.com>
905b4d
Date: Thu, 30 Oct 2014 16:50:27 +0000
905b4d
Subject: [PATCH 52/64] CONFDB: Detect&fix misconf opt refresh_expired_interval
905b4d
MIME-Version: 1.0
905b4d
Content-Type: text/plain; charset=UTF-8
905b4d
Content-Transfer-Encoding: 8bit
905b4d
905b4d
Related to:
905b4d
https://fedorahosted.org/sssd/ticket/2102
905b4d
905b4d
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
905b4d
---
905b4d
 src/confdb/confdb.c | 15 +++++++++++++++
905b4d
 1 file changed, 15 insertions(+)
905b4d
905b4d
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
905b4d
index 8443fe5539e1fd7b6deee6dca7cc689868933757..c55a945a4d3ab4b4070963889a8421d7c78bcad7 100644
905b4d
--- a/src/confdb/confdb.c
905b4d
+++ b/src/confdb/confdb.c
905b4d
@@ -1058,6 +1058,21 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
905b4d
         goto done;
905b4d
     }
905b4d
 
905b4d
+    /* detect and fix misconfiguration */
905b4d
+    if (domain->refresh_expired_interval > entry_cache_timeout) {
905b4d
+        DEBUG(SSSDBG_CONF_SETTINGS,
905b4d
+              "refresh_expired_interval (%d) cannot be greater then "
905b4d
+              "entry_cache_timeout (%u)\n",
905b4d
+              domain->refresh_expired_interval, entry_cache_timeout);
905b4d
+
905b4d
+        domain->refresh_expired_interval = 0.75 * entry_cache_timeout;
905b4d
+
905b4d
+        DEBUG(SSSDBG_CONF_SETTINGS,
905b4d
+              "refresh_expired_interval is being set to recommended value "
905b4d
+              "entry_cache_timeout * 0.75 (%u).\n",
905b4d
+              domain->refresh_expired_interval);
905b4d
+    }
905b4d
+
905b4d
     /* Set the PAM warning time, if specified. If not specified, pass on
905b4d
      * the "not set" value of "-1" which means "use provider default". The
905b4d
      * value 0 means "always display the warning if server sends one" */
905b4d
-- 
905b4d
1.9.3
905b4d