summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_ldap.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-06-23 12:18:35 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:57 +0200
commita7ba9064d6e5446cb3d0a8d773c8f31b95667134 (patch)
treedf9657bd7e8ede4576988bc9f4d4af2d1953a1e6 /source3/winbindd/idmap_ldap.c
parent6659ac11de986bb29225b87cb891c3b50175d1f9 (diff)
downloadsamba-a7ba9064d6e5446cb3d0a8d773c8f31b95667134.tar.gz
samba-a7ba9064d6e5446cb3d0a8d773c8f31b95667134.tar.bz2
samba-a7ba9064d6e5446cb3d0a8d773c8f31b95667134.zip
s3:idmap_ldap: add idmap_rw_ops to idmap_ldap_context and init in db_init()
Diffstat (limited to 'source3/winbindd/idmap_ldap.c')
-rw-r--r--source3/winbindd/idmap_ldap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index 995471f2b8..3223e7d223 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -26,6 +26,7 @@
#include "includes.h"
#include "winbindd.h"
#include "secrets.h"
+#include "idmap_rw.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
@@ -72,6 +73,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 { \
@@ -540,6 +542,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)
{
@@ -601,6 +606,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)) {