summaryrefslogtreecommitdiff
path: root/src/responder/nss/nsssrv_services.c
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:21:09 +0100
commit30812cdfb92923c8d062a5db989015c676a87f07 (patch)
tree092e2b8e7a8b2bf9b8e4571cc757a34d39e202c4 /src/responder/nss/nsssrv_services.c
parent6230ee6822dd61f3591c3c502047b338f09b3292 (diff)
downloadsssd-30812cdfb92923c8d062a5db989015c676a87f07.tar.gz
sssd-30812cdfb92923c8d062a5db989015c676a87f07.tar.bz2
sssd-30812cdfb92923c8d062a5db989015c676a87f07.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/nss/nsssrv_services.c')
-rw-r--r--src/responder/nss/nsssrv_services.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
index ee847f6d..e56ad93a 100644
--- a/src/responder/nss/nsssrv_services.c
+++ b/src/responder/nss/nsssrv_services.c
@@ -325,7 +325,7 @@ getserv_send(TALLOC_CTX *mem_ctx,
midpoint_refresh = 0;
if(nctx->cache_refresh_percent) {
midpoint_refresh = lastUpdate +
- (cacheExpire - lastUpdate)*nctx->cache_refresh_percent/100;
+ (cacheExpire - lastUpdate)*nctx->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,