summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_tdb2.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-06-23 12:01:47 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:56 +0200
commite82ef14008082ae34af5d1f0205aa2b5782fc567 (patch)
treef335d92c0dec87d20655ded7a35446921ffe7c8f /source3/winbindd/idmap_tdb2.c
parent307e5b239ada7f817b941f7ffa4af6f1451ae91e (diff)
downloadsamba-e82ef14008082ae34af5d1f0205aa2b5782fc567.tar.gz
samba-e82ef14008082ae34af5d1f0205aa2b5782fc567.tar.bz2
samba-e82ef14008082ae34af5d1f0205aa2b5782fc567.zip
s3:idmap_tdb2: add rw_ops to idmap_tdb2_context and initialize in idmap_tdb2_db_init
Diffstat (limited to 'source3/winbindd/idmap_tdb2.c')
-rw-r--r--source3/winbindd/idmap_tdb2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c
index a27d3c78e0..cb295ba003 100644
--- a/source3/winbindd/idmap_tdb2.c
+++ b/source3/winbindd/idmap_tdb2.c
@@ -33,6 +33,7 @@
#include "includes.h"
#include "winbindd.h"
+#include "idmap_rw.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
@@ -40,6 +41,7 @@
struct idmap_tdb2_context {
struct db_context *db;
const char *script; /* script to provide idmaps */
+ struct idmap_rw_ops *rw_ops;
};
/* High water mark keys */
@@ -299,6 +301,16 @@ static NTSTATUS idmap_tdb2_db_init(struct idmap_domain *dom,
talloc_free(config_option);
}
+ ctx->rw_ops = talloc_zero(ctx, struct idmap_rw_ops);
+ if (ctx->rw_ops == NULL) {
+ DEBUG(0, ("Out of memory!\n"));
+ ret = NT_STATUS_NO_MEMORY;
+ goto failed;
+ }
+
+ ctx->rw_ops->get_new_id = idmap_tdb2_get_new_id;
+ ctx->rw_ops->set_mapping = idmap_tdb2_set_mapping;
+
dom->private_data = ctx;
ret = idmap_tdb2_open_db(dom);