summaryrefslogtreecommitdiffstats
path: root/src/responder/common
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-12-02 19:05:44 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-12-04 11:22:27 +0100
commit83c5a0123f8d473d46091ee0d41a9ed019c78b6c (patch)
tree3e7ab3b3bc42c830874f62f629c6fe6283a7efc8 /src/responder/common
parentb0662f6564038fd5658ac0b4e1f2423ac994f8ab (diff)
downloadsssd-83c5a0123f8d473d46091ee0d41a9ed019c78b6c.tar.gz
sssd-83c5a0123f8d473d46091ee0d41a9ed019c78b6c.tar.xz
sssd-83c5a0123f8d473d46091ee0d41a9ed019c78b6c.zip
NSS: Fix netgroup midpoint cache refresh
https://fedorahosted.org/sssd/ticket/1683 The result of the percent calculation was always 0 as it used plain ints. The patch switches to using explicit floats to avoid reintroducing the bug again even with brackets.
Diffstat (limited to 'src/responder/common')
-rw-r--r--src/responder/common/responder_cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/responder/common/responder_cmd.c b/src/responder/common/responder_cmd.c
index a9c4e36ee..cb57cba1a 100644
--- a/src/responder/common/responder_cmd.c
+++ b/src/responder/common/responder_cmd.c
@@ -257,7 +257,7 @@ sss_cmd_check_cache(struct ldb_message *msg,
if(cache_refresh_percent) {
midpoint_refresh = lastUpdate +
- (cache_expire - lastUpdate)*cache_refresh_percent/100;
+ (cache_expire - lastUpdate)*cache_refresh_percent/100.0;
if (midpoint_refresh - lastUpdate < 10) {
/* If the percentage results in an expiration
* less than ten seconds after the lastUpdate time,