diff options
author | Michal Zidek <mzidek@redhat.com> | 2013-10-25 17:30:40 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-11-07 11:35:49 +0100 |
commit | 4fcc27c0474b1879119cb04de4ed209711df231e (patch) | |
tree | 985ce455c53a2ae041b93d6ce1462774606dfcfb /src/providers | |
parent | 7e09f933f0e6b7eb04d2e87d80ad1d1a8333a95b (diff) | |
download | sssd-4fcc27c0474b1879119cb04de4ed209711df231e.tar.gz sssd-4fcc27c0474b1879119cb04de4ed209711df231e.tar.xz sssd-4fcc27c0474b1879119cb04de4ed209711df231e.zip |
confdb: Make offline timeout configurable
Added and documented option offline_timeout.
Resolves:
https://fedorahosted.org/sssd/ticket/1718
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/data_provider_be.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 5aef2308a..db73d81a6 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -479,10 +479,21 @@ done: bool be_is_offline(struct be_ctx *ctx) { time_t now = time(NULL); + int offline_timeout; + int ret; /* check if we are past the offline blackout timeout */ - /* FIXME: get offline_timeout from configuration */ - if (ctx->offstat.went_offline + 60 < now) { + ret = confdb_get_int(ctx->cdb, ctx->conf_path, + CONFDB_DOMAIN_OFFLINE_TIMEOUT, 60, + &offline_timeout); + if (ret != EOK) { + DEBUG(SSSDBG_MINOR_FAILURE, + ("Failed to get offline_timeout from confdb. " + "Using default value (60 seconds)\n")); + offline_timeout = 60; + } + + if (ctx->offstat.went_offline + offline_timeout < now) { ctx->offstat.offline = false; } |