From d86fc9163127f7c5bd0c3af950fcddff7911867f Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 21 Mar 2010 02:18:48 -0400 Subject: tools: remove creation of event_context Since the sysdb is now synchronous and creates its own event context we don't need an explicit event context anymore in the tools. --- src/tools/sss_groupdel.c | 2 +- src/tools/sss_groupmod.c | 2 +- src/tools/sss_sync_ops.c | 10 ---------- src/tools/sss_sync_ops.h | 2 -- src/tools/sss_useradd.c | 1 - src/tools/sss_userdel.c | 1 - src/tools/sss_usermod.c | 2 +- src/tools/tools_util.c | 8 -------- src/tools/tools_util.h | 1 - 9 files changed, 3 insertions(+), 26 deletions(-) (limited to 'src/tools') diff --git a/src/tools/sss_groupdel.c b/src/tools/sss_groupdel.c index fe7e7309..006ed09c 100644 --- a/src/tools/sss_groupdel.c +++ b/src/tools/sss_groupdel.c @@ -94,7 +94,7 @@ int main(int argc, const char **argv) goto fini; } - ret = sysdb_getgrnam_sync(tctx, tctx->ev, tctx->sysdb, + ret = sysdb_getgrnam_sync(tctx, tctx->sysdb, tctx->octx->name, tctx->local, tctx->octx); if (ret != EOK) { diff --git a/src/tools/sss_groupmod.c b/src/tools/sss_groupmod.c index 14ae6868..bd684ba0 100644 --- a/src/tools/sss_groupmod.c +++ b/src/tools/sss_groupmod.c @@ -123,7 +123,7 @@ int main(int argc, const char **argv) goto fini; } /* check the username to be able to give sensible error message */ - ret = sysdb_getgrnam_sync(tctx, tctx->ev, tctx->sysdb, + ret = sysdb_getgrnam_sync(tctx, tctx->sysdb, tctx->octx->name, tctx->local, tctx->octx); if (ret != EOK) { diff --git a/src/tools/sss_sync_ops.c b/src/tools/sss_sync_ops.c index 59e5c604..45fd5731 100644 --- a/src/tools/sss_sync_ops.c +++ b/src/tools/sss_sync_ops.c @@ -43,13 +43,6 @@ } \ } while(0) -#define SYNC_LOOP(ops, retval) do { \ - while (!ops->done) { \ - tevent_loop_once(ev); \ - } \ - retval = ops->error; \ -} while(0) - struct sync_op_res { struct ops_ctx *data; int error; @@ -112,7 +105,6 @@ done: * Modify a user */ struct user_mod_state { - struct tevent_context *ev; struct sysdb_ctx *sysdb; struct sysdb_attrs *attrs; @@ -591,7 +583,6 @@ int groupdel(TALLOC_CTX *mem_ctx, * getpwnam, getgrnam and friends */ int sysdb_getpwnam_sync(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, struct sysdb_ctx *sysdb, const char *name, struct sss_domain_info *domain, @@ -666,7 +657,6 @@ int sysdb_getpwnam_sync(TALLOC_CTX *mem_ctx, } int sysdb_getgrnam_sync(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, struct sysdb_ctx *sysdb, const char *name, struct sss_domain_info *domain, diff --git a/src/tools/sss_sync_ops.h b/src/tools/sss_sync_ops.h index e5ba5bee..f0faae94 100644 --- a/src/tools/sss_sync_ops.h +++ b/src/tools/sss_sync_ops.h @@ -93,14 +93,12 @@ int groupmod(TALLOC_CTX *mem_ctx, struct ops_ctx *data); int sysdb_getpwnam_sync(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, struct sysdb_ctx *sysdb, const char *name, struct sss_domain_info *domain, struct ops_ctx *out); int sysdb_getgrnam_sync(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, struct sysdb_ctx *sysdb, const char *name, struct sss_domain_info *domain, diff --git a/src/tools/sss_useradd.c b/src/tools/sss_useradd.c index 620c3b2f..31932154 100644 --- a/src/tools/sss_useradd.c +++ b/src/tools/sss_useradd.c @@ -265,7 +265,6 @@ int main(int argc, const char **argv) * sysdb did assign it automatically, do a lookup */ if (tctx->octx->uid == 0 || tctx->octx->gid == 0) { ret = sysdb_getpwnam_sync(tctx, - tctx->ev, tctx->sysdb, tctx->octx->name, tctx->local, diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c index 55c41c24..be90fc93 100644 --- a/src/tools/sss_userdel.c +++ b/src/tools/sss_userdel.c @@ -232,7 +232,6 @@ int main(int argc, const char **argv) } ret = sysdb_getpwnam_sync(tctx, - tctx->ev, tctx->sysdb, tctx->octx->name, tctx->local, diff --git a/src/tools/sss_usermod.c b/src/tools/sss_usermod.c index 43e685c5..54e3304f 100644 --- a/src/tools/sss_usermod.c +++ b/src/tools/sss_usermod.c @@ -141,7 +141,7 @@ int main(int argc, const char **argv) goto fini; } /* check the username to be able to give sensible error message */ - ret = sysdb_getpwnam_sync(tctx, tctx->ev, tctx->sysdb, + ret = sysdb_getpwnam_sync(tctx, tctx->sysdb, tctx->octx->name, tctx->local, tctx->octx); if (ret != EOK) { diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c index 021495f8..e76ffe76 100644 --- a/src/tools/tools_util.c +++ b/src/tools/tools_util.c @@ -44,13 +44,6 @@ static int setup_db(struct tools_ctx *ctx) char *confdb_path; int ret; - /* Create the event context */ - ctx->ev = tevent_context_init(ctx); - if (ctx->ev == NULL) { - DEBUG(1, ("Could not create event context\n")); - return EIO; - } - confdb_path = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE); if (confdb_path == NULL) { return ENOMEM; @@ -211,7 +204,6 @@ int check_group_names(struct tools_ctx *tctx, ret = EOK; for (i=0; grouplist[i]; ++i) { ret = sysdb_getgrnam_sync(tctx, - tctx->ev, tctx->sysdb, grouplist[i], tctx->local, diff --git a/src/tools/tools_util.h b/src/tools/tools_util.h index 2996f5c1..84fc3be5 100644 --- a/src/tools/tools_util.h +++ b/src/tools/tools_util.h @@ -38,7 +38,6 @@ } while(0) struct tools_ctx { - struct tevent_context *ev; struct confdb_ctx *confdb; struct sysdb_ctx *sysdb; -- cgit