s3:idmap_ldap: add idmap_rw_ops to idmap_ldap_context and init in db_init()
authorMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 10:18:35 +0000 (12:18 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 23 Jun 2010 10:40:42 +0000 (12:40 +0200)
source3/Makefile.in
source3/winbindd/idmap_ldap.c

index f9ce52d94dc1c916ca9ca2e5b2769a89a1b837bc..4430f0ed30e4391f36113ea45b93c322d1428f11 100644 (file)
@@ -2487,9 +2487,9 @@ bin/tdb2.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_tdb2.o $(IDMAP_RW_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) winbindd/idmap_tdb2.o $(IDMAP_RW_OBJ)
 
-bin/ldap.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_ldap.o
+bin/ldap.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_ldap.o $(IDMAP_RW_OBJ)
        @echo "Building plugin $@"
-       @$(SHLD_MODULE) winbindd/idmap_ldap.o
+       @$(SHLD_MODULE) winbindd/idmap_ldap.o $(IDMAP_RW_OBJ)
 
 bin/weird.@SHLIBEXT@: $(BINARY_PREREQS) $(DEVEL_HELP_WEIRD_OBJ)
        @echo "Building plugin $@"
index ca5fc9253515db7eaa0eaf5380f375108849ac5a..e03ecb913ba553744cd6002b8c6d0e2a83c1843e 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "idmap_rw.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
@@ -71,6 +72,7 @@ struct idmap_ldap_context {
        char *user_dn;
        bool anon;
        struct idmap_ldap_alloc_context *alloc;
+       struct idmap_rw_ops *rw_ops;
 };
 
 #define CHECK_ALLOC_DONE(mem) do { \
@@ -538,6 +540,9 @@ static int idmap_ldap_close_destructor(struct idmap_ldap_context *ctx)
  Initialise idmap database.
 ********************************/
 
+static NTSTATUS idmap_ldap_set_mapping(struct idmap_domain *dom,
+                                      const struct id_map *map);
+
 static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom,
                                   const char *params)
 {
@@ -599,6 +604,12 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom,
        ctx->suffix = talloc_strdup(ctx, tmp);
        CHECK_ALLOC_DONE(ctx->suffix);
 
+       ctx->rw_ops = talloc_zero(ctx, struct idmap_rw_ops);
+       CHECK_ALLOC_DONE(ctx->rw_ops);
+
+       ctx->rw_ops->get_new_id = idmap_ldap_get_new_id;
+       ctx->rw_ops->set_mapping = idmap_ldap_set_mapping;
+
        ret = smbldap_init(ctx, winbind_event_context(), ctx->url,
                           &ctx->smbldap_state);
        if (!NT_STATUS_IS_OK(ret)) {