2 ldb database library - ildap backend
4 Copyright (C) Andrew Tridgell 2005
5 Copyright (C) Simo Sorce 2006
7 ** NOTE! The following LGPL license applies to the ldb
8 ** library. This does NOT imply that all of Samba is released
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Lesser General Public
13 License as published by the Free Software Foundation; either
14 version 2 of the License, or (at your option) any later version.
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public
22 License along with this library; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 * Component: ldb ildap backend
31 * Description: This is a ldb backend for the internal ldap
32 * client library in Samba4. By using this backend we are
33 * independent of a system ldap library
35 * Author: Andrew Tridgell
39 * - description: make the module use asyncronous calls
46 #include "ldb/include/includes.h"
48 #include "lib/events/events.h"
49 #include "libcli/ldap/ldap.h"
50 #include "libcli/ldap/ldap_client.h"
51 #include "auth/auth.h"
54 struct ldap_connection *ldap;
55 struct ldb_message *rootDSE;
56 struct ldb_context *ldb;
59 struct ildb_async_context {
60 struct ldb_module *module;
61 struct ldap_request *req;
63 int (*callback)(struct ldb_context *, void *, struct ldb_async_result *);
67 convert a ldb_message structure to a list of ldap_mod structures
68 ready for ildap_add() or ildap_modify()
70 static struct ldap_mod **ildb_msg_to_mods(void *mem_ctx, int *num_mods,
71 const struct ldb_message *msg, int use_flags)
73 struct ldap_mod **mods;
77 /* allocate maximum number of elements needed */
78 mods = talloc_array(mem_ctx, struct ldap_mod *, msg->num_elements+1);
85 for (i = 0; i < msg->num_elements; i++) {
86 const struct ldb_message_element *el = &msg->elements[i];
88 mods[n] = talloc(mods, struct ldap_mod);
94 mods[n]->attrib = *el;
96 switch (el->flags & LDB_FLAG_MOD_MASK) {
97 case LDB_FLAG_MOD_ADD:
98 mods[n]->type = LDAP_MODIFY_ADD;
100 case LDB_FLAG_MOD_DELETE:
101 mods[n]->type = LDAP_MODIFY_DELETE;
103 case LDB_FLAG_MOD_REPLACE:
104 mods[n]->type = LDAP_MODIFY_REPLACE;
121 map an ildap NTSTATUS to a ldb error code
123 static int ildb_map_error(struct ildb_private *ildb, NTSTATUS status)
125 if (NT_STATUS_IS_OK(status)) {
128 talloc_free(ildb->ldb->err_string);
129 ildb->ldb->err_string = talloc_strdup(ildb, ldap_errstr(ildb->ldap, status));
130 if (NT_STATUS_IS_LDAP(status)) {
131 return NT_STATUS_LDAP_CODE(status);
133 return LDB_ERR_OPERATIONS_ERROR;
136 static void ildb_request_timeout(struct event_context *ev, struct timed_event *te,
137 struct timeval t, void *private_data)
139 struct ldb_async_handle *handle = talloc_get_type(private_data, struct ldb_async_handle);
140 struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context);
142 if (ac->req->state == LDAP_REQUEST_PENDING) {
143 DLIST_REMOVE(ac->req->conn->pending, ac->req);
146 handle->status = LDB_ERR_TIME_LIMIT_EXCEEDED;
151 static void ildb_callback(struct ldap_request *req)
153 struct ldb_async_handle *handle = talloc_get_type(req->async.private_data, struct ldb_async_handle);
154 struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context);
155 struct ildb_private *ildb = talloc_get_type(ac->module->private_data, struct ildb_private);
159 handle->status = LDB_SUCCESS;
161 if (!NT_STATUS_IS_OK(req->status)) {
162 handle->status = ildb_map_error(ildb, req->status);
166 if (req->num_replies < 1) {
167 handle->status = LDB_ERR_OPERATIONS_ERROR;
173 case LDAP_TAG_ModifyRequest:
174 if (req->replies[0]->type != LDAP_TAG_ModifyResponse) {
175 handle->status = LDB_ERR_PROTOCOL_ERROR;
178 status = ldap_check_response(req->conn, &req->replies[0]->r.GeneralResult);
179 handle->status = ildb_map_error(ildb, status);
180 if (ac->callback && handle->status == LDB_SUCCESS) {
181 /* FIXME: build a corresponding ares to pass on */
182 handle->status = ac->callback(ac->module->ldb, ac->context, NULL);
184 handle->state = LDB_ASYNC_DONE;
187 case LDAP_TAG_AddRequest:
188 if (req->replies[0]->type != LDAP_TAG_AddResponse) {
189 handle->status = LDB_ERR_PROTOCOL_ERROR;
192 status = ldap_check_response(req->conn, &req->replies[0]->r.GeneralResult);
193 handle->status = ildb_map_error(ildb, status);
194 if (ac->callback && handle->status == LDB_SUCCESS) {
195 /* FIXME: build a corresponding ares to pass on */
196 handle->status = ac->callback(ac->module->ldb, ac->context, NULL);
198 handle->state = LDB_ASYNC_DONE;
201 case LDAP_TAG_DelRequest:
202 if (req->replies[0]->type != LDAP_TAG_DelResponse) {
203 handle->status = LDB_ERR_PROTOCOL_ERROR;
206 status = ldap_check_response(req->conn, &req->replies[0]->r.GeneralResult);
207 handle->status = ildb_map_error(ildb, status);
208 if (ac->callback && handle->status == LDB_SUCCESS) {
209 /* FIXME: build a corresponding ares to pass on */
210 handle->status = ac->callback(ac->module->ldb, ac->context, NULL);
212 handle->state = LDB_ASYNC_DONE;
215 case LDAP_TAG_ModifyDNRequest:
216 if (req->replies[0]->type != LDAP_TAG_ModifyDNResponse) {
217 handle->status = LDB_ERR_PROTOCOL_ERROR;
220 status = ldap_check_response(req->conn, &req->replies[0]->r.GeneralResult);
221 handle->status = ildb_map_error(ildb, status);
222 if (ac->callback && handle->status == LDB_SUCCESS) {
223 /* FIXME: build a corresponding ares to pass on */
224 handle->status = ac->callback(ac->module->ldb, ac->context, NULL);
226 handle->state = LDB_ASYNC_DONE;
229 case LDAP_TAG_SearchRequest:
230 /* loop over all messages */
231 for (i = 0; i < req->num_replies; i++) {
232 struct ldap_SearchResEntry *search;
233 struct ldb_async_result *ares = NULL;
234 struct ldap_message *msg;
237 ares = talloc_zero(ac, struct ldb_async_result);
239 handle->status = LDB_ERR_OPERATIONS_ERROR;
243 msg = req->replies[i];
246 case LDAP_TAG_SearchResultDone:
248 status = ldap_check_response(req->conn, &msg->r.GeneralResult);
249 if (!NT_STATUS_IS_OK(status)) {
250 ldb_debug(ac->module->ldb, LDB_DEBUG_ERROR, "Error: %s\n" ,ldap_errstr(req->conn, status));
251 handle->status = ildb_map_error(ildb, status);
256 ares->controls = talloc_steal(ares, msg->controls);
258 if (msg->r.SearchResultDone.resultcode) {
259 if (msg->r.SearchResultDone.errormessage) {
260 ldb_set_errstring(ac->module->ldb, talloc_strdup(ac->module, msg->r.SearchResultDone.errormessage));
264 handle->status = msg->r.SearchResultDone.resultcode;
265 handle->state = LDB_ASYNC_DONE;
266 ares->type = LDB_REPLY_DONE;
269 case LDAP_TAG_SearchResultEntry:
272 ares->message = ldb_msg_new(ares);
273 if (!ares->message) {
274 handle->status = LDB_ERR_OPERATIONS_ERROR;
278 search = &(msg->r.SearchResultEntry);
280 ares->message->dn = ldb_dn_explode_or_special(ares->message, search->dn);
281 if (ares->message->dn == NULL) {
282 handle->status = LDB_ERR_OPERATIONS_ERROR;
285 ares->message->num_elements = search->num_attributes;
286 ares->message->elements = talloc_steal(ares->message, search->attributes);
288 handle->status = LDB_SUCCESS;
289 handle->state = LDB_ASYNC_PENDING;
290 ares->type = LDB_REPLY_ENTRY;
293 case LDAP_TAG_SearchResultReference:
295 ares->referral = talloc_strdup(ares, msg->r.SearchResultReference.referral);
297 handle->status = LDB_SUCCESS;
298 handle->state = LDB_ASYNC_PENDING;
299 ares->type = LDB_REPLY_REFERRAL;
303 /* TAG not handled, fail ! */
304 handle->status = LDB_ERR_PROTOCOL_ERROR;
308 ret = ac->callback(ac->module->ldb, ac->context, ares);
310 handle->status = ret;
314 talloc_free(req->replies);
316 req->num_replies = 0;
321 handle->status = LDB_ERR_PROTOCOL_ERROR;
326 static int ildb_request_send(struct ldb_module *module, struct ldap_message *msg,
328 int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
330 struct ldb_async_handle **handle)
332 struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
333 struct ildb_async_context *ildb_ac;
334 struct ldb_async_handle *h;
335 struct ldap_request *req;
337 h = talloc_zero(ildb->ldap, struct ldb_async_handle);
339 ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
340 return LDB_ERR_OPERATIONS_ERROR;
345 ildb_ac = talloc(h, struct ildb_async_context);
346 if (ildb_ac == NULL) {
347 ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
349 return LDB_ERR_OPERATIONS_ERROR;
352 h->private_data = (void *)ildb_ac;
354 h->state = LDB_ASYNC_INIT;
355 h->status = LDB_SUCCESS;
357 req = ldap_request_send(ildb->ldap, msg);
359 ldb_set_errstring(module->ldb, talloc_asprintf(module, "async send request failed"));
360 return LDB_ERR_OPERATIONS_ERROR;
363 ildb_ac->req = talloc_steal(ildb_ac, req);
364 ildb_ac->module = module;
365 ildb_ac->context = context;
366 ildb_ac->callback = callback;
368 req->async.fn = ildb_callback;
369 req->async.private_data = (void *)h;
371 talloc_free(req->time_event);
372 req->time_event = NULL;
374 req->time_event = event_add_timed(req->conn->event.event_ctx, h,
375 timeval_current_ofs(timeout, 0),
376 ildb_request_timeout, h);
386 search for matching records using an asynchronous function
388 static int ildb_search(struct ldb_module *module, struct ldb_request *req)
390 struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
391 struct ldap_message *msg;
394 req->async.handle = NULL;
396 if (!req->async.callback || !req->async.context) {
397 ldb_set_errstring(module->ldb, talloc_asprintf(module, "Async interface called with NULL callback function or NULL context"));
398 return LDB_ERR_OPERATIONS_ERROR;
401 if (req->op.search.tree == NULL) {
402 ldb_set_errstring(module->ldb, talloc_asprintf(module, "Invalid expression parse tree"));
403 return LDB_ERR_OPERATIONS_ERROR;
406 msg = new_ldap_message(ildb);
408 ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
409 return LDB_ERR_OPERATIONS_ERROR;
412 msg->type = LDAP_TAG_SearchRequest;
414 if (req->op.search.base == NULL) {
415 if (ildb->rootDSE != NULL) {
416 msg->r.SearchRequest.basedn =
417 talloc_strdup(msg, ldb_msg_find_string(ildb->rootDSE, "defaultNamingContext", ""));
419 msg->r.SearchRequest.basedn = talloc_strdup(msg, "");
422 msg->r.SearchRequest.basedn = ldb_dn_linearize(msg, req->op.search.base);
424 if (msg->r.SearchRequest.basedn == NULL) {
425 ldb_set_errstring(module->ldb, talloc_asprintf(module, "Unable to determine baseDN"));
427 return LDB_ERR_OPERATIONS_ERROR;
430 if (req->op.search.scope == LDB_SCOPE_DEFAULT) {
431 msg->r.SearchRequest.scope = LDB_SCOPE_SUBTREE;
433 msg->r.SearchRequest.scope = req->op.search.scope;
436 msg->r.SearchRequest.deref = LDAP_DEREFERENCE_NEVER;
437 msg->r.SearchRequest.timelimit = 0;
438 msg->r.SearchRequest.sizelimit = 0;
439 msg->r.SearchRequest.attributesonly = 0;
440 msg->r.SearchRequest.tree = discard_const(req->op.search.tree);
442 for (n = 0; req->op.search.attrs && req->op.search.attrs[n]; n++) /* noop */ ;
443 msg->r.SearchRequest.num_attributes = n;
444 msg->r.SearchRequest.attributes = discard_const(req->op.search.attrs);
445 msg->controls = req->controls;
447 return ildb_request_send(module, msg, req->async.context, req->async.callback, req->async.timeout, &(req->async.handle));
453 static int ildb_add(struct ldb_module *module, struct ldb_request *req)
455 struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
456 struct ldap_message *msg;
457 struct ldap_mod **mods;
460 req->async.handle = NULL;
462 /* ignore ltdb specials */
463 if (ldb_dn_is_special(req->op.add.message->dn)) {
467 msg = new_ldap_message(ildb->ldap);
469 return LDB_ERR_OPERATIONS_ERROR;
472 msg->type = LDAP_TAG_AddRequest;
474 msg->r.AddRequest.dn = ldb_dn_linearize(msg, req->op.add.message->dn);
475 if (msg->r.AddRequest.dn == NULL) {
477 return LDB_ERR_INVALID_DN_SYNTAX;
480 mods = ildb_msg_to_mods(msg, &n, req->op.add.message, 0);
483 return LDB_ERR_OPERATIONS_ERROR;
486 msg->r.AddRequest.num_attributes = n;
487 msg->r.AddRequest.attributes = talloc_array(msg, struct ldb_message_element, n);
488 if (msg->r.AddRequest.attributes == NULL) {
490 return LDB_ERR_OPERATIONS_ERROR;
493 for (i = 0; i < n; i++) {
494 msg->r.AddRequest.attributes[i] = mods[i]->attrib;
497 return ildb_request_send(module, msg, req->async.context, req->async.callback, req->async.timeout, &(req->async.handle));
503 static int ildb_modify(struct ldb_module *module, struct ldb_request *req)
505 struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
506 struct ldap_message *msg;
507 struct ldap_mod **mods;
510 req->async.handle = NULL;
512 /* ignore ltdb specials */
513 if (ldb_dn_is_special(req->op.mod.message->dn)) {
517 msg = new_ldap_message(ildb->ldap);
519 return LDB_ERR_OPERATIONS_ERROR;
522 msg->type = LDAP_TAG_ModifyRequest;
524 msg->r.ModifyRequest.dn = ldb_dn_linearize(msg, req->op.mod.message->dn);
525 if (msg->r.ModifyRequest.dn == NULL) {
527 return LDB_ERR_INVALID_DN_SYNTAX;
530 mods = ildb_msg_to_mods(msg, &n, req->op.mod.message, 1);
533 return LDB_ERR_OPERATIONS_ERROR;
536 msg->r.ModifyRequest.num_mods = n;
537 msg->r.ModifyRequest.mods = talloc_array(msg, struct ldap_mod, n);
538 if (msg->r.ModifyRequest.mods == NULL) {
540 return LDB_ERR_OPERATIONS_ERROR;
543 for (i = 0; i < n; i++) {
544 msg->r.ModifyRequest.mods[i] = *mods[i];
547 return ildb_request_send(module, msg,
551 &(req->async.handle));
557 static int ildb_delete(struct ldb_module *module, struct ldb_request *req)
559 struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
560 struct ldap_message *msg;
562 req->async.handle = NULL;
564 /* ignore ltdb specials */
565 if (ldb_dn_is_special(req->op.del.dn)) {
569 msg = new_ldap_message(ildb->ldap);
571 return LDB_ERR_OPERATIONS_ERROR;
574 msg->type = LDAP_TAG_DelRequest;
576 msg->r.DelRequest.dn = ldb_dn_linearize(msg, req->op.del.dn);
577 if (msg->r.DelRequest.dn == NULL) {
579 return LDB_ERR_INVALID_DN_SYNTAX;
582 return ildb_request_send(module, msg,
586 &(req->async.handle));
592 static int ildb_rename(struct ldb_module *module, struct ldb_request *req)
594 struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
595 struct ldap_message *msg;
597 req->async.handle = NULL;
599 /* ignore ltdb specials */
600 if (ldb_dn_is_special(req->op.rename.olddn) || ldb_dn_is_special(req->op.rename.newdn)) {
604 msg = new_ldap_message(ildb->ldap);
606 return LDB_ERR_OPERATIONS_ERROR;
609 msg->type = LDAP_TAG_ModifyDNRequest;
610 msg->r.ModifyDNRequest.dn = ldb_dn_linearize(msg, req->op.rename.olddn);
611 if (msg->r.ModifyDNRequest.dn == NULL) {
613 return LDB_ERR_INVALID_DN_SYNTAX;
616 msg->r.ModifyDNRequest.newrdn =
617 talloc_asprintf(msg, "%s=%s",
618 req->op.rename.newdn->components[0].name,
619 ldb_dn_escape_value(msg, req->op.rename.newdn->components[0].value));
620 if (msg->r.ModifyDNRequest.newrdn == NULL) {
622 return LDB_ERR_OPERATIONS_ERROR;
625 msg->r.ModifyDNRequest.newsuperior =
626 ldb_dn_linearize(msg,
627 ldb_dn_get_parent(msg, req->op.rename.newdn));
628 if (msg->r.ModifyDNRequest.newsuperior == NULL) {
630 return LDB_ERR_INVALID_DN_SYNTAX;
633 msg->r.ModifyDNRequest.deleteolddn = True;
635 return ildb_request_send(module, msg,
639 &(req->async.handle));
642 static int ildb_start_trans(struct ldb_module *module)
644 /* TODO implement a local locking mechanism here */
649 static int ildb_end_trans(struct ldb_module *module)
651 /* TODO implement a local transaction mechanism here */
656 static int ildb_del_trans(struct ldb_module *module)
658 /* TODO implement a local locking mechanism here */
663 static int ildb_request(struct ldb_module *module, struct ldb_request *req)
665 return LDB_ERR_OPERATIONS_ERROR;
668 static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type type)
670 struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context);
672 if (handle->state == LDB_ASYNC_DONE) {
673 return handle->status;
677 return LDB_ERR_OPERATIONS_ERROR;
680 handle->state = LDB_ASYNC_INIT;
684 if (event_loop_once(ac->req->conn->event.event_ctx) != 0) {
685 return LDB_ERR_OTHER;
689 while (handle->status == LDB_SUCCESS && handle->state != LDB_ASYNC_DONE) {
690 if (event_loop_once(ac->req->conn->event.event_ctx) != 0) {
691 return LDB_ERR_OTHER;
696 return LDB_ERR_OPERATIONS_ERROR;
699 return handle->status;
702 static int ildb_rootdse_callback(struct ldb_context *ldb, void *context, struct ldb_async_result *ares)
704 struct ildb_private *ildb;
706 if (!context || !ares) {
707 ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
711 ildb = talloc_get_type(context, struct ildb_private);
713 /* we are interested only in the single reply (rootdse) we receive here */
714 switch (ares->type) {
715 case LDB_REPLY_ENTRY:
716 if (ildb->rootDSE != NULL) {
717 /* what ? more than one rootdse entry ?! */
720 ildb->rootDSE = talloc_steal(ildb, ares->message);
723 case LDB_REPLY_REFERRAL:
735 return LDB_ERR_OPERATIONS_ERROR;
739 fetch the rootDSE for later use
741 static int ildb_init(struct ldb_module *module)
743 struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
744 struct ldb_request *req;
747 req = talloc(ildb, struct ldb_request);
749 return LDB_ERR_OPERATIONS_ERROR;
752 ildb->rootDSE = NULL;
754 req->operation = LDB_SEARCH;
755 req->op.search.base = ldb_dn_new(req);
756 req->op.search.scope = LDB_SCOPE_BASE;
757 req->op.search.tree = ldb_parse_tree(req, "dn=dc=rootDSE");
758 req->op.search.attrs = NULL;
759 req->controls = NULL;
760 req->async.context = ildb;
761 req->async.callback = ildb_rootdse_callback;
762 ldb_set_timeout(module->ldb, req, 60);
764 ret = ildb_search(module, req);
765 if (ret != LDB_SUCCESS) {
770 ret = ildb_async_wait(req->async.handle, LDB_WAIT_ALL);
776 static const struct ldb_module_ops ildb_ops = {
778 .search = ildb_search,
780 .modify = ildb_modify,
782 .rename = ildb_rename,
783 .request = ildb_request,
784 .start_transaction = ildb_start_trans,
785 .end_transaction = ildb_end_trans,
786 .del_transaction = ildb_del_trans,
787 .async_wait = ildb_async_wait,
788 .init_context = ildb_init
792 connect to the database
794 static int ildb_connect(struct ldb_context *ldb, const char *url,
795 unsigned int flags, const char *options[],
796 struct ldb_module **module)
798 struct ildb_private *ildb = NULL;
800 struct cli_credentials *creds;
802 ildb = talloc(ldb, struct ildb_private);
808 ildb->rootDSE = NULL;
811 ildb->ldap = ldap_new_connection(ildb, ldb_get_opaque(ldb, "EventContext"));
817 if (flags == LDB_FLG_RECONNECT) {
818 ldap_set_reconn_params(ildb->ldap, 10);
821 status = ldap_connect(ildb->ldap, url);
822 if (!NT_STATUS_IS_OK(status)) {
823 ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to connect to ldap URL '%s' - %s\n",
824 url, ldap_errstr(ildb->ldap, status));
829 *module = talloc(ldb, struct ldb_module);
835 (*module)->ldb = ldb;
836 (*module)->prev = (*module)->next = NULL;
837 (*module)->private_data = ildb;
838 (*module)->ops = &ildb_ops;
840 /* caller can optionally setup credentials using the opaque token 'credentials' */
841 creds = talloc_get_type(ldb_get_opaque(ldb, "credentials"), struct cli_credentials);
843 struct auth_session_info *session_info = talloc_get_type(ldb_get_opaque(ldb, "sessionInfo"), struct auth_session_info);
845 creds = session_info->credentials;
849 if (creds != NULL && cli_credentials_authentication_requested(creds)) {
850 const char *bind_dn = cli_credentials_get_bind_dn(creds);
852 const char *password = cli_credentials_get_password(creds);
853 status = ldap_bind_simple(ildb->ldap, bind_dn, password);
854 if (!NT_STATUS_IS_OK(status)) {
855 ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
856 ldap_errstr(ildb->ldap, status));
860 status = ldap_bind_sasl(ildb->ldap, creds);
861 if (!NT_STATUS_IS_OK(status)) {
862 ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
863 ldap_errstr(ildb->ldap, status));
876 int ldb_ildap_init(void)
878 return ldb_register_backend("ldap", ildb_connect) +
879 ldb_register_backend("ldapi", ildb_connect) +
880 ldb_register_backend("ldaps", ildb_connect);