summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-03-19 11:55:13 -0400
committerSimo Sorce <ssorce@redhat.com>2009-03-20 11:14:56 -0400
commit83eefb156ec3ba8cd42886c63af19af8e7bc9b69 (patch)
treecdb00724d0110518ef98b3439905fd39db08bf74 /server
parent7cf16d5930031d07a59a9d4741a49dac4409f695 (diff)
downloadsssd-83eefb156ec3ba8cd42886c63af19af8e7bc9b69.tar.gz
sssd-83eefb156ec3ba8cd42886c63af19af8e7bc9b69.tar.bz2
sssd-83eefb156ec3ba8cd42886c63af19af8e7bc9b69.zip
Avoid nested events in confdb
Diffstat (limited to 'server')
-rw-r--r--server/confdb/confdb.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c
index eda2d2b4..838a9a73 100644
--- a/server/confdb/confdb.c
+++ b/server/confdb/confdb.c
@@ -39,6 +39,7 @@
} while(0)
struct confdb_ctx {
+ struct tevent_context *pev;
struct ldb_context *ldb;
};
@@ -658,7 +659,20 @@ int confdb_init(TALLOC_CTX *mem_ctx,
if (!cdb)
return ENOMEM;
- cdb->ldb = ldb_init(cdb, ev);
+ /* Because condb calls use sync ldb calls, we create a separate event
+ * context here. This will prevent the ldb sync calls to start nested
+ * events.
+ * NOTE: this means that we *cannot* do async calls and return in confdb
+ * unless we convert all calls and hook back to the main event context.
+ */
+
+ cdb->pev = tevent_context_init(cdb);
+ if (!cdb->pev) {
+ talloc_free(cdb);
+ return EIO;
+ }
+
+ cdb->ldb = ldb_init(cdb, cdb->pev);
if (!cdb->ldb) {
talloc_free(cdb);
return EIO;