summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-03-21 00:59:30 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-04-12 09:22:16 -0400
commit9db5a5140356479a58f2e7212fc5c4ad6135bb7f (patch)
tree85d65e015f099a1d2c6e9e1cf07e94a7c630c25f
parente5e32021c23f3726d68ee756e8e3de48b3214063 (diff)
downloadsssd-9db5a5140356479a58f2e7212fc5c4ad6135bb7f.tar.gz
sssd-9db5a5140356479a58f2e7212fc5c4ad6135bb7f.tar.xz
sssd-9db5a5140356479a58f2e7212fc5c4ad6135bb7f.zip
sysydb: Finally stop using a common event context
This commit completes the migration to a synchronous sysdb
-rw-r--r--src/db/sysdb.c26
-rw-r--r--src/db/sysdb.h2
-rw-r--r--src/db/sysdb_private.h2
-rw-r--r--src/monitor/monitor.c2
-rw-r--r--src/providers/data_provider_be.c2
-rw-r--r--src/python/pysss.c2
-rw-r--r--src/responder/common/responder_common.c2
-rw-r--r--src/tests/auth-tests.c2
-rw-r--r--src/tests/sysdb-tests.c2
-rw-r--r--src/tools/tools_util.c2
10 files changed, 14 insertions, 30 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 1d86c4b34..2d4a38d79 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -446,7 +446,6 @@ int sysdb_transaction_cancel(struct sysdb_ctx *ctx)
/* =Initialization======================================================== */
static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
struct sss_domain_info *domain,
const char *db_path,
bool allow_upgrade,
@@ -632,7 +631,6 @@ done:
}
static int sysdb_check_upgrade_02(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
struct sss_domain_info *domains,
const char *db_path)
{
@@ -662,7 +660,7 @@ static int sysdb_check_upgrade_02(TALLOC_CTX *mem_ctx,
goto exit;
}
- ldb = ldb_init(tmp_ctx, ev);
+ ldb = ldb_init(tmp_ctx, NULL);
if (!ldb) {
ret = EIO;
goto exit;
@@ -767,7 +765,7 @@ static int sysdb_check_upgrade_02(TALLOC_CTX *mem_ctx,
}
/* reopen */
- ldb = ldb_init(tmp_ctx, ev);
+ ldb = ldb_init(tmp_ctx, NULL);
if (!ldb) {
ret = EIO;
goto exit;
@@ -807,7 +805,7 @@ static int sysdb_check_upgrade_02(TALLOC_CTX *mem_ctx,
}
/* create new dom db */
- ret = sysdb_domain_init_internal(tmp_ctx, ev, dom,
+ ret = sysdb_domain_init_internal(tmp_ctx, dom,
db_path, false, &ctx);
if (ret != EOK) {
goto done;
@@ -1194,7 +1192,6 @@ done:
}
static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
struct sss_domain_info *domain,
const char *db_path,
bool allow_upgrade,
@@ -1215,13 +1212,8 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
if (!ctx) {
return ENOMEM;
}
- ctx->ev = ev;
ctx->domain = domain;
- /* FIXME: TEMPORARY
- * remove once sysdb code is all converted to synchronous */
- tevent_loop_allow_nesting(ctx->ev);
-
/* The local provider s the only true MPG,
* for the other domains, the provider actually unrolls MPGs */
if (strcasecmp(domain->provider, "local") == 0) {
@@ -1236,7 +1228,7 @@ static int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
}
DEBUG(5, ("DB File for %s: %s\n", domain->name, ctx->ldb_file));
- ctx->ldb = ldb_init(ctx, ev);
+ ctx->ldb = ldb_init(ctx, NULL);
if (!ctx->ldb) {
return EIO;
}
@@ -1436,7 +1428,6 @@ done:
}
int sysdb_init(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
struct confdb_ctx *cdb,
const char *alt_db_path,
bool allow_upgrade,
@@ -1447,8 +1438,6 @@ int sysdb_init(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *ctx;
int ret;
- if (!ev) return EINVAL;
-
ctx_list = talloc_zero(mem_ctx, struct sysdb_ctx_list);
if (!ctx_list) {
return ENOMEM;
@@ -1473,7 +1462,7 @@ int sysdb_init(TALLOC_CTX *mem_ctx,
if (allow_upgrade) {
/* check if we have an old sssd.ldb to upgrade */
- ret = sysdb_check_upgrade_02(ctx_list, ev, domains,
+ ret = sysdb_check_upgrade_02(ctx_list, domains,
ctx_list->db_path);
if (ret != EOK) {
talloc_zfree(ctx_list);
@@ -1491,7 +1480,7 @@ int sysdb_init(TALLOC_CTX *mem_ctx,
return ENOMEM;
}
- ret = sysdb_domain_init_internal(ctx_list, ev, dom,
+ ret = sysdb_domain_init_internal(ctx_list, dom,
ctx_list->db_path,
allow_upgrade, &ctx);
if (ret != EOK) {
@@ -1514,12 +1503,11 @@ int sysdb_init(TALLOC_CTX *mem_ctx,
}
int sysdb_domain_init(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
struct sss_domain_info *domain,
const char *db_path,
struct sysdb_ctx **_ctx)
{
- return sysdb_domain_init_internal(mem_ctx, ev, domain,
+ return sysdb_domain_init_internal(mem_ctx, domain,
db_path, false, _ctx);
}
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 65e72141f..5b6f21895 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -223,7 +223,6 @@ int sysdb_transaction_cancel(struct sysdb_ctx *ctx);
* call this function *only* once to initialize the database and get
* the sysdb ctx */
int sysdb_init(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
struct confdb_ctx *cdb,
const char *alt_db_path,
bool allow_upgrade,
@@ -231,7 +230,6 @@ int sysdb_init(TALLOC_CTX *mem_ctx,
/* used to initialize only one domain database.
* Do NOT use if sysdb_init has already been called */
int sysdb_domain_init(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
struct sss_domain_info *domain,
const char *db_path,
struct sysdb_ctx **_ctx);
diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h
index e5494bd62..676dbddf0 100644
--- a/src/db/sysdb_private.h
+++ b/src/db/sysdb_private.h
@@ -62,8 +62,6 @@
#include "db/sysdb.h"
struct sysdb_ctx {
- struct tevent_context *ev;
-
struct sss_domain_info *domain;
bool mpg;
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index d08630929..0a98d09c2 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1719,7 +1719,7 @@ int monitor_process_init(struct mt_ctx *ctx,
if (!tmp_ctx) {
return ENOMEM;
}
- ret = sysdb_init(tmp_ctx, ctx->ev, ctx->cdb, NULL, true, &db_list);
+ ret = sysdb_init(tmp_ctx, ctx->cdb, NULL, true, &db_list);
if (ret != EOK) {
return ret;
}
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 15f6882cd..239b92af4 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -1062,7 +1062,7 @@ int be_process_init(TALLOC_CTX *mem_ctx,
return ret;
}
- ret = sysdb_domain_init(ctx, ev, ctx->domain, DB_PATH, &ctx->sysdb);
+ ret = sysdb_domain_init(ctx, ctx->domain, DB_PATH, &ctx->sysdb);
if (ret != EOK) {
DEBUG(0, ("fatal error opening cache database\n"));
return ret;
diff --git a/src/python/pysss.c b/src/python/pysss.c
index 8fa9b9d04..7801be5ef 100644
--- a/src/python/pysss.c
+++ b/src/python/pysss.c
@@ -802,7 +802,7 @@ static PyObject *PySssLocalObject_new(PyTypeObject *type,
}
/* open 'local' sysdb at default path */
- ret = sysdb_domain_init(self->mem_ctx, self->ev, self->local, DB_PATH, &self->sysdb);
+ ret = sysdb_domain_init(self->mem_ctx, self->local, DB_PATH, &self->sysdb);
if (ret != EOK) {
talloc_free(mem_ctx);
PyErr_SetSssErrorWithMessage(ret,
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 315eb7354..501c35205 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -679,7 +679,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
}
}
- ret = sysdb_init(rctx, ev, cdb, NULL, false, &rctx->db_list);
+ ret = sysdb_init(rctx, cdb, NULL, false, &rctx->db_list);
if (ret != EOK) {
DEBUG(0, ("fatal error initializing resp_ctx\n"));
return ret;
diff --git a/src/tests/auth-tests.c b/src/tests/auth-tests.c
index 64864090b..a3de43c47 100644
--- a/src/tests/auth-tests.c
+++ b/src/tests/auth-tests.c
@@ -141,7 +141,7 @@ static int setup_sysdb_tests(struct sysdb_test_ctx **ctx)
return ret;
}
- ret = sysdb_domain_init(test_ctx, test_ctx->ev,
+ ret = sysdb_domain_init(test_ctx,
test_ctx->domain, TESTS_PATH, &test_ctx->sysdb);
if (ret != EOK) {
fail("Could not initialize connection to the sysdb (%d)", ret);
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index 10d77ff40..3b3816cb0 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -147,7 +147,7 @@ static int setup_sysdb_tests(struct sysdb_test_ctx **ctx)
return ret;
}
- ret = sysdb_domain_init(test_ctx, test_ctx->ev,
+ ret = sysdb_domain_init(test_ctx,
test_ctx->domain, TESTS_PATH, &test_ctx->sysdb);
if (ret != EOK) {
fail("Could not initialize connection to the sysdb (%d)", ret);
diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c
index cae6f5c11..021495f8b 100644
--- a/src/tools/tools_util.c
+++ b/src/tools/tools_util.c
@@ -70,7 +70,7 @@ static int setup_db(struct tools_ctx *ctx)
}
/* open 'local' sysdb at default path */
- ret = sysdb_domain_init(ctx, ctx->ev, ctx->local, DB_PATH, &ctx->sysdb);
+ ret = sysdb_domain_init(ctx, ctx->local, DB_PATH, &ctx->sysdb);
if (ret != EOK) {
DEBUG(1, ("Could not initialize connection to the sysdb\n"));
return ret;