summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_tdb.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-06-23 12:12:37 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:57 +0200
commit5a82cffb8b9444afbfa763cad2a7be57a1874d66 (patch)
treee1a3679e4fa2a169444e3a03a07cdf1d9133ed13 /source3/winbindd/idmap_tdb.c
parent3f3cff9127b971c0de50975ed47cbb2d102a0e03 (diff)
downloadsamba-5a82cffb8b9444afbfa763cad2a7be57a1874d66.tar.gz
samba-5a82cffb8b9444afbfa763cad2a7be57a1874d66.tar.bz2
samba-5a82cffb8b9444afbfa763cad2a7be57a1874d66.zip
s3:idmap_tdb: add idmap_rw_ops to idmap_tdb_context and initialize them in init_db
Diffstat (limited to 'source3/winbindd/idmap_tdb.c')
-rw-r--r--source3/winbindd/idmap_tdb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index 75a5e44274..66d9701bcf 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "winbindd.h"
+#include "idmap_rw.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
@@ -36,6 +37,7 @@
struct idmap_tdb_context {
struct db_context *db;
+ struct idmap_rw_ops *rw_ops;
};
/* High water mark keys */
@@ -478,6 +480,9 @@ static NTSTATUS idmap_tdb_get_new_id(struct idmap_domain *dom,
Initialise idmap database.
*****************************/
+static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom,
+ const struct id_map *map);
+
static NTSTATUS idmap_tdb_db_init(struct idmap_domain *dom, const char *params)
{
NTSTATUS ret;
@@ -498,6 +503,16 @@ static NTSTATUS idmap_tdb_db_init(struct idmap_domain *dom, const char *params)
}
#endif
+ 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_tdb_get_new_id;
+ ctx->rw_ops->set_mapping = idmap_tdb_set_mapping;
+
dom->private_data = ctx;
ret = idmap_tdb_open_db(dom);