summaryrefslogtreecommitdiff
path: root/src/responder/nss
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder/nss')
-rw-r--r--src/responder/nss/nsssrv_netgroup.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index 83e79a2f..593b7e43 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -416,6 +416,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
struct getent_ctx *netgr;
struct sysdb_ctx *sysdb;
char *name = NULL;
+ uint32_t lifetime;
/* Check each domain for this netgroup name */
while (dom) {
@@ -531,7 +532,14 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
name, dom->name));
netgr->ready = true;
netgr->found = true;
- set_netgr_lifetime(dom->netgroup_timeout, step_ctx, netgr);
+ if (step_ctx->nctx->cache_refresh_percent) {
+ lifetime = dom->netgroup_timeout *
+ (step_ctx->nctx->cache_refresh_percent / 100);
+ } else {
+ lifetime = dom->netgroup_timeout;
+ }
+ if (lifetime < 10) lifetime = 10;
+ set_netgr_lifetime(lifetime, step_ctx, netgr);
return EOK;
}