summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_sudo.c
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-05-07 12:23:02 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-06-29 11:37:17 -0400
commit44bff89750c5451112d4ef7a10b6d9d0c8442f85 (patch)
tree8cb2c29adecd3d09bd9bd1a80e2ab61dbd8eed52 /src/providers/ldap/sdap_sudo.c
parent9f714651c7d21908c94b70fc755697a3b220a22f (diff)
downloadsssd-44bff89750c5451112d4ef7a10b6d9d0c8442f85.tar.gz
sssd-44bff89750c5451112d4ef7a10b6d9d0c8442f85.tar.xz
sssd-44bff89750c5451112d4ef7a10b6d9d0c8442f85.zip
sudo provider: remove old timer
Diffstat (limited to 'src/providers/ldap/sdap_sudo.c')
-rw-r--r--src/providers/ldap/sdap_sudo.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c
index ba96f2cbf..271964d9a 100644
--- a/src/providers/ldap/sdap_sudo.c
+++ b/src/providers/ldap/sdap_sudo.c
@@ -28,7 +28,6 @@
#include "providers/ldap/sdap_async.h"
#include "providers/ldap/sdap_sudo.h"
#include "providers/ldap/sdap_sudo_cache.h"
-#include "providers/ldap/sdap_sudo_timer.h"
#include "db/sysdb_sudo.h"
struct sdap_sudo_full_refresh_state {
@@ -67,8 +66,6 @@ struct bet_ops sdap_sudo_ops = {
.finalize = sdap_sudo_shutdown
};
-int sdap_sudo_setup_tasks(struct sdap_id_ctx *id_ctx);
-
int sdap_sudo_init(struct be_ctx *be_ctx,
struct sdap_id_ctx *id_ctx,
struct bet_ops **ops,
@@ -89,70 +86,6 @@ int sdap_sudo_init(struct be_ctx *be_ctx,
return ret;
}
- ret = sdap_sudo_setup_tasks(id_ctx);
- if (ret != EOK) {
- DEBUG(SSSDBG_OP_FAILURE, ("SUDO setup failed [%d]: %s\n",
- ret, strerror(ret)));
- return ret;
- }
-
- return EOK;
-}
-
-int sdap_sudo_setup_tasks(struct sdap_id_ctx *id_ctx)
-{
- struct sdap_sudo_refresh_ctx *refresh_ctx = NULL;
- struct timeval tv;
- int ret = EOK;
- bool refreshed = false;
- bool refresh_enabled = dp_opt_get_bool(id_ctx->opts->basic,
- SDAP_SUDO_REFRESH_ENABLED);
-
- /* set up periodical update of sudo rules */
- if (refresh_enabled) {
- refresh_ctx = sdap_sudo_refresh_ctx_init(id_ctx, id_ctx->be, id_ctx,
- id_ctx->opts,
- tevent_timeval_zero());
- if (refresh_ctx == NULL) {
- DEBUG(SSSDBG_CRIT_FAILURE,
- ("sdap_sudo_refresh_ctx_init() failed!\n"));
- return ENOMEM;
- }
-
- /* If this is the first startup, we need to kick off
- * an refresh immediately, to close a window where
- * clients requesting sudo information won't get an
- * immediate reply with no entries
- */
- ret = sysdb_sudo_get_refreshed(id_ctx->be->sysdb, &refreshed);
- if (ret != EOK) {
- return ret;
- }
- if (refreshed) {
- /* At least one update has previously run,
- * so clients will get cached data. We will delay
- * starting to enumerate by 10s so we don't slow
- * down the startup process if this is happening
- * during system boot.
- */
- tv = tevent_timeval_current_ofs(10, 0);
- DEBUG(SSSDBG_FUNC_DATA, ("Delaying first refresh of SUDO rules "
- "for 10 seconds\n"));
- } else {
- /* This is our first startup. Schedule the
- * update to start immediately once we
- * enter the mainloop.
- */
- tv = tevent_timeval_current();
- }
-
- ret = sdap_sudo_refresh_set_timer(refresh_ctx, tv);
- if (ret != EOK) {
- talloc_free(refresh_ctx);
- return ret;
- }
- }
-
return EOK;
}