diff options
-rw-r--r-- | source3/winbindd/idmap_ldap.c | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c index cb5f67d913..b6674ee02b 100644 --- a/source3/winbindd/idmap_ldap.c +++ b/source3/winbindd/idmap_ldap.c @@ -251,88 +251,6 @@ static int idmap_ldap_alloc_close_destructor(struct idmap_ldap_alloc_context *ct return 0; } -static NTSTATUS idmap_ldap_alloc_init(struct idmap_domain *dom, - const char *params) -{ - NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; - const char *tmp; - struct idmap_ldap_context *ctx; - - /* Only do init if we are online */ - if (idmap_is_offline()) { - return NT_STATUS_FILE_IS_OFFLINE; - } - - ctx = talloc_get_type(dom->private_data, struct idmap_ldap_context); - - ctx->alloc = talloc_zero(ctx, struct idmap_ldap_alloc_context); - CHECK_ALLOC_DONE(ctx->alloc); - - if (params && *params) { - /* assume location is the only parameter */ - ctx->alloc->url = talloc_strdup(ctx->alloc, params); - } else { - tmp = lp_parm_const_string(-1, "idmap alloc config", - "ldap_url", NULL); - - if ( ! tmp) { - DEBUG(1, ("ERROR: missing idmap ldap url\n")); - ret = NT_STATUS_UNSUCCESSFUL; - goto done; - } - - ctx->alloc->url = talloc_strdup(ctx->alloc, tmp); - } - CHECK_ALLOC_DONE(ctx->alloc->url); - - trim_char(ctx->alloc->url, '\"', '\"'); - - tmp = lp_parm_const_string(-1, "idmap alloc config", - "ldap_base_dn", NULL); - if ( ! tmp || ! *tmp) { - tmp = lp_ldap_idmap_suffix(); - if ( ! tmp) { - DEBUG(1, ("ERROR: missing idmap ldap suffix\n")); - ret = NT_STATUS_UNSUCCESSFUL; - goto done; - } - } - - ctx->alloc->suffix = talloc_strdup(ctx->alloc, tmp); - CHECK_ALLOC_DONE(ctx->alloc->suffix); - - ret = smbldap_init(ctx->alloc, winbind_event_context(), - ctx->alloc->url, - &ctx->alloc->smbldap_state); - if (!NT_STATUS_IS_OK(ret)) { - DEBUG(1, ("ERROR: smbldap_init (%s) failed!\n", - ctx->alloc->url)); - goto done; - } - - talloc_set_destructor(ctx->alloc, idmap_ldap_alloc_close_destructor); - - ret = get_credentials(ctx->alloc, - ctx->alloc->smbldap_state, - "idmap alloc config", NULL, - &ctx->alloc->user_dn); - if ( !NT_STATUS_IS_OK(ret) ) { - DEBUG(1,("idmap_ldap_alloc_init: Failed to get connection " - "credentials (%s)\n", nt_errstr(ret))); - goto done; - } - - /* see if the idmap suffix and sub entries exists */ - - ret = verify_idpool(dom); - - done: - if ( !NT_STATUS_IS_OK( ret ) ) - TALLOC_FREE(ctx->alloc); - - return ret; -} - /******************************** Allocate a new uid or gid ********************************/ |