4 Copyright (C) Simo Sorce 2005-2008
5 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2007-2009
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * Component: ldb extended dn control module
26 * Description: this module builds a special dn for returned search
27 * results, and fixes some other aspects of the result (returned case issues)
35 #include "ldb/include/ldb.h"
36 #include "ldb/include/ldb_errors.h"
37 #include "ldb/include/ldb_module.h"
38 #include "libcli/security/dom_sid.h"
39 #include "librpc/gen_ndr/ndr_misc.h"
40 #include "librpc/gen_ndr/ndr_security.h"
41 #include "librpc/ndr/libndr.h"
42 #include "dsdb/samdb/samdb.h"
45 struct extended_dn_out_private {
48 struct dsdb_openldap_dereference_control *dereference_control;
51 static char **copy_attrs(void *mem_ctx, const char * const * attrs)
56 for (num = 0; attrs[num]; num++);
58 nattrs = talloc_array(mem_ctx, char *, num + 1);
59 if (!nattrs) return NULL;
61 for(i = 0; i < num; i++) {
62 nattrs[i] = talloc_strdup(nattrs, attrs[i]);
73 static bool add_attrs(void *mem_ctx, char ***attrs, const char *attr)
78 for (num = 0; (*attrs)[num]; num++);
80 nattrs = talloc_realloc(mem_ctx, *attrs, char *, num + 2);
81 if (!nattrs) return false;
85 nattrs[num] = talloc_strdup(nattrs, attr);
86 if (!nattrs[num]) return false;
88 nattrs[num + 1] = NULL;
93 /* Fix the DN so that the relative attribute names are in upper case so that the DN:
94 cn=Adminstrator,cn=users,dc=samba,dc=example,dc=com becomes
95 CN=Adminstrator,CN=users,DC=samba,DC=example,DC=com
99 static int fix_dn(struct ldb_context *ldb, struct ldb_dn *dn)
102 char *upper_rdn_attr;
104 for (i=0; i < ldb_dn_get_comp_num(dn); i++) {
105 /* We need the attribute name in upper case */
106 upper_rdn_attr = strupper_talloc(dn,
107 ldb_dn_get_component_name(dn, i));
108 if (!upper_rdn_attr) {
112 /* And replace it with CN=foo (we need the attribute in upper case */
113 ret = ldb_dn_set_component(dn, i, upper_rdn_attr,
114 *ldb_dn_get_component_val(dn, i));
115 talloc_free(upper_rdn_attr);
116 if (ret != LDB_SUCCESS) {
123 /* Inject the extended DN components, so the DN cn=Adminstrator,cn=users,dc=samba,dc=example,dc=com becomes
124 <GUID=541203ae-f7d6-47ef-8390-bfcf019f9583>;<SID=S-1-5-21-4177067393-1453636373-93818737-500>;cn=Adminstrator,cn=users,dc=samba,dc=example,dc=com */
126 static int inject_extended_dn_out(struct ldb_reply *ares,
127 struct ldb_context *ldb,
133 const DATA_BLOB *guid_blob;
134 const DATA_BLOB *sid_blob;
136 guid_blob = ldb_msg_find_ldb_val(ares->message, "objectGUID");
137 sid_blob = ldb_msg_find_ldb_val(ares->message, "objectSID");
140 ldb_set_errstring(ldb, "Did not find objectGUID to inject into extended DN");
141 return LDB_ERR_OPERATIONS_ERROR;
144 ret = ldb_dn_set_extended_component(ares->message->dn, "GUID", guid_blob);
145 if (ret != LDB_SUCCESS) {
149 ret = ldb_dn_set_extended_component(ares->message->dn, "SID", sid_blob);
150 if (ret != LDB_SUCCESS) {
156 ldb_msg_remove_attr(ares->message, "objectGUID");
159 if (sid_blob && remove_sid) {
160 ldb_msg_remove_attr(ares->message, "objectSID");
166 static int handle_dereference_openldap(struct ldb_dn *dn,
167 struct dsdb_openldap_dereference_result **dereference_attrs,
168 const char *attr, const DATA_BLOB *val)
170 const struct ldb_val *entryUUIDblob, *sid_blob;
171 struct ldb_message fake_msg; /* easier to use routines that expect an ldb_message */
174 fake_msg.num_elements = 0;
176 /* Look for this attribute in the returned control */
177 for (j = 0; dereference_attrs && dereference_attrs[j]; j++) {
178 struct ldb_val source_dn = data_blob_string_const(dereference_attrs[j]->dereferenced_dn);
179 if (ldb_attr_cmp(dereference_attrs[j]->source_attribute, attr) == 0
180 && data_blob_cmp(&source_dn, val) == 0) {
181 fake_msg.num_elements = dereference_attrs[j]->num_attributes;
182 fake_msg.elements = dereference_attrs[j]->attributes;
186 if (!fake_msg.num_elements) {
189 /* Look for an OpenLDAP entryUUID */
191 entryUUIDblob = ldb_msg_find_ldb_val(&fake_msg, "entryUUID");
194 struct ldb_val guid_blob;
197 status = GUID_from_data_blob(entryUUIDblob, &guid);
199 if (!NT_STATUS_IS_OK(status)) {
200 return LDB_ERR_INVALID_DN_SYNTAX;
202 status = GUID_to_ndr_blob(&guid, dn, &guid_blob);
203 if (!NT_STATUS_IS_OK(status)) {
204 return LDB_ERR_INVALID_DN_SYNTAX;
207 ldb_dn_set_extended_component(dn, "GUID", &guid_blob);
210 sid_blob = ldb_msg_find_ldb_val(&fake_msg, "objectSID");
212 /* Look for the objectSID */
214 ldb_dn_set_extended_component(dn, "SID", sid_blob);
219 static int handle_dereference_fds(struct ldb_dn *dn,
220 struct dsdb_openldap_dereference_result **dereference_attrs,
221 const char *attr, const DATA_BLOB *val)
223 const struct ldb_val *nsUniqueIdBlob, *sidBlob;
224 struct ldb_message fake_msg; /* easier to use routines that expect an ldb_message */
227 fake_msg.num_elements = 0;
229 /* Look for this attribute in the returned control */
230 for (j = 0; dereference_attrs && dereference_attrs[j]; j++) {
231 struct ldb_val source_dn = data_blob_string_const(dereference_attrs[j]->dereferenced_dn);
232 if (ldb_attr_cmp(dereference_attrs[j]->source_attribute, attr) == 0
233 && data_blob_cmp(&source_dn, val) == 0) {
234 fake_msg.num_elements = dereference_attrs[j]->num_attributes;
235 fake_msg.elements = dereference_attrs[j]->attributes;
239 if (!fake_msg.num_elements) {
243 /* Look for the nsUniqueId */
245 nsUniqueIdBlob = ldb_msg_find_ldb_val(&fake_msg, "nsUniqueId");
246 if (nsUniqueIdBlob) {
248 struct ldb_val guid_blob;
251 status = NS_GUID_from_string((char *)nsUniqueIdBlob->data, &guid);
253 if (!NT_STATUS_IS_OK(status)) {
254 return LDB_ERR_INVALID_DN_SYNTAX;
256 status = GUID_to_ndr_blob(&guid, dn, &guid_blob);
257 if (!NT_STATUS_IS_OK(status)) {
258 return LDB_ERR_INVALID_DN_SYNTAX;
261 ldb_dn_set_extended_component(dn, "GUID", &guid_blob);
264 /* Look for the objectSID */
266 sidBlob = ldb_msg_find_ldb_val(&fake_msg, "sambaSID");
268 enum ndr_err_code ndr_err;
270 struct ldb_val sid_blob;
273 sid = dom_sid_parse_length(NULL, sidBlob);
276 return LDB_ERR_INVALID_DN_SYNTAX;
279 ndr_err = ndr_push_struct_blob(&sid_blob, NULL, sid,
280 (ndr_push_flags_fn_t)ndr_push_dom_sid);
282 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
283 return LDB_ERR_INVALID_DN_SYNTAX;
286 ldb_dn_set_extended_component(dn, "SID", &sid_blob);
292 struct extended_search_context {
293 struct ldb_module *module;
294 const struct dsdb_schema *schema;
295 struct ldb_request *req;
302 static int extended_callback(struct ldb_request *req, struct ldb_reply *ares,
303 int (*handle_dereference)(struct ldb_dn *dn,
304 struct dsdb_openldap_dereference_result **dereference_attrs,
305 const char *attr, const DATA_BLOB *val))
307 struct extended_search_context *ac;
308 struct ldb_control *control;
309 struct dsdb_openldap_dereference_result_control *dereference_control = NULL;
312 struct ldb_message *msg = ares->message;
313 struct extended_dn_out_private *p;
314 struct ldb_context *ldb;
315 bool have_reveal_control, checked_reveal_control=false;
317 ac = talloc_get_type(req->context, struct extended_search_context);
318 p = talloc_get_type(ldb_module_get_private(ac->module), struct extended_dn_out_private);
319 ldb = ldb_module_get_ctx(ac->module);
321 return ldb_module_done(ac->req, NULL, NULL,
322 LDB_ERR_OPERATIONS_ERROR);
324 if (ares->error != LDB_SUCCESS) {
325 return ldb_module_done(ac->req, ares->controls,
326 ares->response, ares->error);
329 switch (ares->type) {
330 case LDB_REPLY_REFERRAL:
331 return ldb_module_send_referral(ac->req, ares->referral);
334 return ldb_module_done(ac->req, ares->controls,
335 ares->response, LDB_SUCCESS);
336 case LDB_REPLY_ENTRY:
340 if (p && p->normalise) {
341 ret = fix_dn(ldb, ares->message->dn);
342 if (ret != LDB_SUCCESS) {
343 return ldb_module_done(ac->req, NULL, NULL, ret);
348 /* for each record returned post-process to add any derived
349 attributes that have been asked for */
350 ret = inject_extended_dn_out(ares, ldb,
351 ac->extended_type, ac->remove_guid,
353 if (ret != LDB_SUCCESS) {
354 return ldb_module_done(ac->req, NULL, NULL, ret);
358 if ((p && p->normalise) || ac->inject) {
359 const struct ldb_val *val = ldb_msg_find_ldb_val(ares->message, "distinguishedName");
361 ldb_msg_remove_attr(ares->message, "distinguishedName");
363 ret = ldb_msg_add_steal_string(ares->message, "distinguishedName",
364 ldb_dn_get_extended_linearized(ares->message, ares->message->dn, ac->extended_type));
366 ret = ldb_msg_add_linearized_dn(ares->message,
370 if (ret != LDB_SUCCESS) {
376 if (p && p->dereference) {
377 control = ldb_reply_get_control(ares, DSDB_OPENLDAP_DEREFERENCE_CONTROL);
379 if (control && control->data) {
380 dereference_control = talloc_get_type(control->data, struct dsdb_openldap_dereference_result_control);
384 /* Walk the returned elements (but only if we have a schema to
385 * interpret the list with) */
386 for (i = 0; ac->schema && i < msg->num_elements; i++) {
387 bool make_extended_dn;
388 const struct dsdb_attribute *attribute;
389 attribute = dsdb_attribute_by_lDAPDisplayName(ac->schema, msg->elements[i].name);
395 /* If we are also in 'normalise' mode, then
396 * fix the attribute names to be in the
398 msg->elements[i].name = talloc_strdup(msg->elements, attribute->lDAPDisplayName);
399 if (!msg->elements[i].name) {
401 return ldb_module_done(ac->req, NULL, NULL, LDB_ERR_OPERATIONS_ERROR);
405 /* distinguishedName has been dealt with above */
406 if (ldb_attr_cmp(msg->elements[i].name, "distinguishedName") == 0) {
410 /* Look to see if this attributeSyntax is a DN */
411 if (dsdb_dn_oid_to_format(attribute->syntax->ldap_oid) == DSDB_INVALID_DN) {
415 make_extended_dn = ac->inject;
417 /* Always show plain DN in case of Object(OR-Name) syntax */
418 if (make_extended_dn) {
419 make_extended_dn = (strcmp(attribute->syntax->ldap_oid, DSDB_SYNTAX_OR_NAME) != 0);
422 for (j = 0; j < msg->elements[i].num_values; j++) {
425 struct dsdb_dn *dsdb_dn = NULL;
426 struct ldb_val *plain_dn = &msg->elements[i].values[j];
428 if (!checked_reveal_control) {
429 have_reveal_control =
430 ldb_request_get_control(req, LDB_CONTROL_REVEAL_INTERNALS) != NULL;
431 checked_reveal_control = true;
434 /* this is a fast method for detecting deleted
435 linked attributes, working on the unparsed
437 if (dsdb_dn_is_deleted_val(plain_dn) && !have_reveal_control) {
438 /* it's a deleted linked attribute,
439 and we don't have the reveal control */
440 memmove(&msg->elements[i].values[j],
441 &msg->elements[i].values[j+1],
442 (msg->elements[i].num_values-(j+1))*sizeof(struct ldb_val));
443 msg->elements[i].num_values--;
449 dsdb_dn = dsdb_dn_parse(msg, ldb, plain_dn, attribute->syntax->ldap_oid);
451 if (!dsdb_dn || !ldb_dn_validate(dsdb_dn->dn)) {
452 ldb_asprintf_errstring(ldb,
453 "could not parse %.*s in %s on %s as a %s DN",
454 (int)plain_dn->length, plain_dn->data,
455 msg->elements[i].name, ldb_dn_get_linearized(msg->dn),
456 attribute->syntax->ldap_oid);
457 talloc_free(dsdb_dn);
458 return ldb_module_done(ac->req, NULL, NULL, LDB_ERR_INVALID_DN_SYNTAX);
462 /* don't let users see the internal extended
464 if (!have_reveal_control) {
465 const char *accept[] = { "GUID", "SID", "WKGUID", NULL };
466 ldb_dn_extended_filter(dn, accept);
470 ret = fix_dn(ldb, dn);
471 if (ret != LDB_SUCCESS) {
472 talloc_free(dsdb_dn);
473 return ldb_module_done(ac->req, NULL, NULL, ret);
477 /* If we are running in dereference mode (such
478 * as against OpenLDAP) then the DN in the msg
479 * above does not contain the extended values,
480 * and we need to look in the dereference
483 /* Look for this value in the attribute */
485 if (dereference_control) {
486 ret = handle_dereference(dn,
487 dereference_control->attributes,
488 msg->elements[i].name,
489 &msg->elements[i].values[j]);
490 if (ret != LDB_SUCCESS) {
491 talloc_free(dsdb_dn);
492 return ldb_module_done(ac->req, NULL, NULL, ret);
496 if (make_extended_dn) {
497 dn_str = dsdb_dn_get_extended_linearized(msg->elements[i].values,
498 dsdb_dn, ac->extended_type);
500 dn_str = dsdb_dn_get_linearized(msg->elements[i].values,
506 talloc_free(dsdb_dn);
507 return ldb_module_done(ac->req, NULL, NULL, LDB_ERR_OPERATIONS_ERROR);
509 msg->elements[i].values[j] = data_blob_string_const(dn_str);
510 talloc_free(dsdb_dn);
512 if (msg->elements[i].num_values == 0) {
513 /* we've deleted all of the values from this
514 * element - remove the element */
515 memmove(&msg->elements[i],
517 (msg->num_elements-(i+1))*sizeof(struct ldb_message_element));
522 return ldb_module_send_entry(ac->req, msg, ares->controls);
525 static int extended_callback_ldb(struct ldb_request *req, struct ldb_reply *ares)
527 return extended_callback(req, ares, NULL);
530 static int extended_callback_openldap(struct ldb_request *req, struct ldb_reply *ares)
532 return extended_callback(req, ares, handle_dereference_openldap);
535 static int extended_callback_fds(struct ldb_request *req, struct ldb_reply *ares)
537 return extended_callback(req, ares, handle_dereference_fds);
540 static int extended_dn_out_search(struct ldb_module *module, struct ldb_request *req,
541 int (*callback)(struct ldb_request *req, struct ldb_reply *ares))
543 struct ldb_control *control;
544 struct ldb_control *storage_format_control;
545 struct ldb_extended_dn_control *extended_ctrl = NULL;
546 struct extended_search_context *ac;
547 struct ldb_request *down_req;
549 const char * const *const_attrs;
550 struct ldb_context *ldb = ldb_module_get_ctx(module);
554 struct extended_dn_out_private *p = talloc_get_type(ldb_module_get_private(module), struct extended_dn_out_private);
556 /* The schema manipulation does not apply to special DNs */
557 if (ldb_dn_is_special(req->op.search.base)) {
558 return ldb_next_request(module, req);
561 /* check if there's an extended dn control */
562 control = ldb_request_get_control(req, LDB_CONTROL_EXTENDED_DN_OID);
563 if (control && control->data) {
564 extended_ctrl = talloc_get_type(control->data, struct ldb_extended_dn_control);
565 if (!extended_ctrl) {
566 return LDB_ERR_PROTOCOL_ERROR;
570 /* Look to see if, as we are in 'store DN+GUID+SID' mode, the
571 * client is after the storage format (to fill in linked
573 storage_format_control = ldb_request_get_control(req, DSDB_CONTROL_DN_STORAGE_FORMAT_OID);
574 if (!control && storage_format_control && storage_format_control->data) {
575 extended_ctrl = talloc_get_type(storage_format_control->data, struct ldb_extended_dn_control);
576 if (!extended_ctrl) {
577 ldb_set_errstring(ldb, "extended_dn_out: extended_ctrl was of the wrong data type");
578 return LDB_ERR_PROTOCOL_ERROR;
582 ac = talloc_zero(req, struct extended_search_context);
588 ac->schema = dsdb_get_schema(ldb, ac);
591 ac->remove_guid = false;
592 ac->remove_sid = false;
594 const_attrs = req->op.search.attrs;
596 /* We only need to do special processing if we were asked for
597 * the extended DN, or we are 'store DN+GUID+SID'
598 * (!dereference) mode. (This is the normal mode for LDB on
600 if (control || (storage_format_control && p && !p->dereference)) {
603 ac->extended_type = extended_ctrl->type;
605 ac->extended_type = 0;
608 /* check if attrs only is specified, in that case check wether we need to modify them */
609 if (req->op.search.attrs && !is_attr_in_list(req->op.search.attrs, "*")) {
610 if (! is_attr_in_list(req->op.search.attrs, "objectGUID")) {
611 ac->remove_guid = true;
613 if (! is_attr_in_list(req->op.search.attrs, "objectSID")) {
614 ac->remove_sid = true;
616 if (ac->remove_guid || ac->remove_sid) {
617 new_attrs = copy_attrs(ac, req->op.search.attrs);
618 if (new_attrs == NULL) {
622 if (ac->remove_guid) {
623 if (!add_attrs(ac, &new_attrs, "objectGUID"))
624 return ldb_operr(ldb);
626 if (ac->remove_sid) {
627 if (!add_attrs(ac, &new_attrs, "objectSID"))
628 return ldb_operr(ldb);
630 const_attrs = (const char * const *)new_attrs;
635 ret = ldb_build_search_req_ex(&down_req,
638 req->op.search.scope,
644 if (ret != LDB_SUCCESS) {
648 /* mark extended DN and storage format controls as done */
650 critical = control->critical;
651 control->critical = 0;
654 if (storage_format_control) {
655 storage_format_control->critical = 0;
658 /* Add in dereference control, if we were asked to, we are
659 * using the 'dereference' mode (such as with an OpenLDAP
660 * backend) and have the control prepared */
661 if (control && p && p->dereference && p->dereference_control) {
662 ret = ldb_request_add_control(down_req,
663 DSDB_OPENLDAP_DEREFERENCE_CONTROL,
664 critical, p->dereference_control);
665 if (ret != LDB_SUCCESS) {
670 /* perform the search */
671 return ldb_next_request(module, down_req);
674 static int extended_dn_out_ldb_search(struct ldb_module *module, struct ldb_request *req)
676 return extended_dn_out_search(module, req, extended_callback_ldb);
679 static int extended_dn_out_openldap_search(struct ldb_module *module, struct ldb_request *req)
681 return extended_dn_out_search(module, req, extended_callback_openldap);
684 static int extended_dn_out_fds_search(struct ldb_module *module, struct ldb_request *req)
686 return extended_dn_out_search(module, req, extended_callback_fds);
689 static int extended_dn_out_ldb_init(struct ldb_module *module)
693 struct extended_dn_out_private *p = talloc(module, struct extended_dn_out_private);
694 struct dsdb_extended_dn_store_format *dn_format;
696 ldb_module_set_private(module, p);
699 return ldb_oom(ldb_module_get_ctx(module));
702 dn_format = talloc(p, struct dsdb_extended_dn_store_format);
705 return ldb_oom(ldb_module_get_ctx(module));
708 dn_format->store_extended_dn_in_ldb = true;
709 ret = ldb_set_opaque(ldb_module_get_ctx(module), DSDB_EXTENDED_DN_STORE_FORMAT_OPAQUE_NAME, dn_format);
710 if (ret != LDB_SUCCESS) {
715 p->dereference = false;
716 p->normalise = false;
718 ret = ldb_mod_register_control(module, LDB_CONTROL_EXTENDED_DN_OID);
719 if (ret != LDB_SUCCESS) {
720 ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_ERROR,
721 "extended_dn_out: Unable to register control with rootdse!\n");
722 return ldb_operr(ldb_module_get_ctx(module));
725 return ldb_next_init(module);
728 static int extended_dn_out_dereference_init(struct ldb_module *module, const char *attrs[])
732 struct extended_dn_out_private *p = talloc_zero(module, struct extended_dn_out_private);
733 struct dsdb_extended_dn_store_format *dn_format;
734 struct dsdb_openldap_dereference_control *dereference_control;
735 struct dsdb_attribute *cur;
736 struct ldb_context *ldb = ldb_module_get_ctx(module);
737 const struct dsdb_schema *schema;
739 ldb_module_set_private(module, p);
745 dn_format = talloc(p, struct dsdb_extended_dn_store_format);
748 return ldb_oom(ldb_module_get_ctx(module));
751 dn_format->store_extended_dn_in_ldb = false;
753 ret = ldb_set_opaque(ldb_module_get_ctx(module), DSDB_EXTENDED_DN_STORE_FORMAT_OPAQUE_NAME, dn_format);
754 if (ret != LDB_SUCCESS) {
759 p->dereference = true;
761 /* At the moment, servers that need dereference also need the
762 * DN and attribute names to be normalised */
765 ret = ldb_mod_register_control(module, LDB_CONTROL_EXTENDED_DN_OID);
766 if (ret != LDB_SUCCESS) {
767 ldb_debug(ldb, LDB_DEBUG_ERROR,
768 "extended_dn_out: Unable to register control with rootdse!\n");
769 return ldb_operr(ldb);
772 ret = ldb_next_init(module);
774 if (ret != LDB_SUCCESS) {
778 schema = dsdb_get_schema(ldb, p);
780 /* No schema on this DB (yet) */
784 p->dereference_control = dereference_control
785 = talloc_zero(p, struct dsdb_openldap_dereference_control);
787 if (!p->dereference_control) {
791 for (cur = schema->attributes; cur; cur = cur->next) {
792 if (dsdb_dn_oid_to_format(cur->syntax->ldap_oid) == DSDB_INVALID_DN) {
795 dereference_control->dereference
796 = talloc_realloc(p, dereference_control->dereference,
797 struct dsdb_openldap_dereference *, i + 2);
798 if (!dereference_control) {
801 dereference_control->dereference[i] = talloc(dereference_control->dereference,
802 struct dsdb_openldap_dereference);
803 if (!dereference_control->dereference[i]) {
806 dereference_control->dereference[i]->source_attribute = cur->lDAPDisplayName;
807 dereference_control->dereference[i]->dereference_attribute = attrs;
809 dereference_control->dereference[i] = NULL;
814 static int extended_dn_out_openldap_init(struct ldb_module *module)
816 static const char *attrs[] = {
822 return extended_dn_out_dereference_init(module, attrs);
825 static int extended_dn_out_fds_init(struct ldb_module *module)
827 static const char *attrs[] = {
833 return extended_dn_out_dereference_init(module, attrs);
836 _PUBLIC_ const struct ldb_module_ops ldb_extended_dn_out_ldb_module_ops = {
837 .name = "extended_dn_out_ldb",
838 .search = extended_dn_out_ldb_search,
839 .init_context = extended_dn_out_ldb_init,
842 _PUBLIC_ const struct ldb_module_ops ldb_extended_dn_out_openldap_module_ops = {
843 .name = "extended_dn_out_openldap",
844 .search = extended_dn_out_openldap_search,
845 .init_context = extended_dn_out_openldap_init,
848 _PUBLIC_ const struct ldb_module_ops ldb_extended_dn_out_fds_module_ops = {
849 .name = "extended_dn_out_fds",
850 .search = extended_dn_out_fds_search,
851 .init_context = extended_dn_out_fds_init,