summaryrefslogtreecommitdiffstats
path: root/src/db
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 /src/db
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
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.c26
-rw-r--r--src/db/sysdb.h2
-rw-r--r--src/db/sysdb_private.h2
3 files changed, 7 insertions, 23 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;