2 Unix SMB/CIFS implementation.
4 Copyright (C) Stefan Metzmacher 2004
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "ldap_server/ldap_server.h"
23 #include "dlinklist.h"
24 #include "libcli/ldap/ldap.h"
25 #include "lib/ldb/include/ldb.h"
26 #include "lib/ldb/include/ldb_errors.h"
27 #include "dsdb/samdb/samdb.h"
29 #define VALID_DN_SYNTAX(dn,i) do {\
31 return NT_STATUS_NO_MEMORY;\
32 } else if ((dn)->comp_num < (i)) {\
33 result = LDAP_INVALID_DN_SYNTAX;\
34 errstr = "Invalid DN (" #i " components needed for '" #dn "')";\
39 static int map_ldb_error(struct ldb_context *ldb, int err, const char **errstring)
41 *errstring = ldb_errstring(ldb);
50 static int get_ldb_controls(void *mem_ctx, struct ldap_Control **controls, struct ldb_control ***lcontrols)
52 struct ldb_control **lctrl;
55 if (controls == NULL || controls[0] == NULL) {
64 for (i = 0; controls[i] != NULL; i++) {
65 lctrl = talloc_realloc(mem_ctx, lctrl, struct ldb_control *, l + 2);
69 lctrl[l] = talloc(lctrl, struct ldb_control);
70 if (lctrl[l] == NULL) {
73 lctrl[l]->oid = controls[i]->oid;
74 lctrl[l]->critical = controls[i]->critical;
75 lctrl[l]->data = controls[i]->value;
86 connect to the sam database
88 NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
90 conn->ldb = samdb_connect(conn, conn->session_info);
91 if (conn->ldb == NULL) {
92 return NT_STATUS_INTERNAL_DB_CORRUPTION;
94 ldb_set_opaque(conn->ldb, "server_credentials", conn->server_credentials);
99 struct ldapsrv_reply *ldapsrv_init_reply(struct ldapsrv_call *call, uint8_t type)
101 struct ldapsrv_reply *reply;
103 reply = talloc(call, struct ldapsrv_reply);
107 reply->msg = talloc(reply, struct ldap_message);
108 if (reply->msg == NULL) {
113 reply->msg->messageid = call->request->messageid;
114 reply->msg->type = type;
115 reply->msg->controls = NULL;
120 void ldapsrv_queue_reply(struct ldapsrv_call *call, struct ldapsrv_reply *reply)
122 DLIST_ADD_END(call->replies, reply, struct ldapsrv_reply *);
125 NTSTATUS ldapsrv_unwilling(struct ldapsrv_call *call, int error)
127 struct ldapsrv_reply *reply;
128 struct ldap_ExtendedResponse *r;
130 DEBUG(10,("Unwilling type[%d] id[%d]\n", call->request->type, call->request->messageid));
132 reply = ldapsrv_init_reply(call, LDAP_TAG_ExtendedResponse);
134 return NT_STATUS_NO_MEMORY;
137 r = &reply->msg->r.ExtendedResponse;
138 r->response.resultcode = error;
139 r->response.dn = NULL;
140 r->response.errormessage = NULL;
141 r->response.referral = NULL;
145 ldapsrv_queue_reply(call, reply);
149 static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
151 struct ldap_SearchRequest *req = &call->request->r.SearchRequest;
152 struct ldap_SearchResEntry *ent;
153 struct ldap_Result *done;
154 struct ldapsrv_reply *ent_r, *done_r;
156 struct ldb_context *samdb = call->conn->ldb;
157 struct ldb_dn *basedn;
158 struct ldb_result *res = NULL;
159 struct ldb_request lreq;
160 enum ldb_scope scope = LDB_SCOPE_DEFAULT;
161 const char **attrs = NULL;
162 const char *errstr = NULL;
163 int success_limit = 1;
164 int result = LDAP_SUCCESS;
168 DEBUG(10, ("SearchRequest"));
169 DEBUGADD(10, (" basedn: %s", req->basedn));
170 DEBUGADD(10, (" filter: %s\n", ldb_filter_from_tree(call, req->tree)));
172 local_ctx = talloc_named(call, 0, "sldb_Search local memory context");
173 NT_STATUS_HAVE_NO_MEMORY(local_ctx);
175 basedn = ldb_dn_explode(local_ctx, req->basedn);
176 VALID_DN_SYNTAX(basedn, 0);
178 DEBUG(10, ("SearchRequest: basedn: [%s]\n", req->basedn));
179 DEBUG(10, ("SearchRequest: filter: [%s]\n", ldb_filter_from_tree(call, req->tree)));
181 switch (req->scope) {
182 case LDAP_SEARCH_SCOPE_BASE:
183 DEBUG(10,("SearchRequest: scope: [BASE]\n"));
184 scope = LDB_SCOPE_BASE;
187 case LDAP_SEARCH_SCOPE_SINGLE:
188 DEBUG(10,("SearchRequest: scope: [ONE]\n"));
189 scope = LDB_SCOPE_ONELEVEL;
192 case LDAP_SEARCH_SCOPE_SUB:
193 DEBUG(10,("SearchRequest: scope: [SUB]\n"));
194 scope = LDB_SCOPE_SUBTREE;
199 if (req->num_attributes >= 1) {
200 attrs = talloc_array(samdb, const char *, req->num_attributes+1);
201 NT_STATUS_HAVE_NO_MEMORY(attrs);
203 for (i=0; i < req->num_attributes; i++) {
204 DEBUG(10,("SearchRequest: attrs: [%s]\n",req->attributes[i]));
205 attrs[i] = req->attributes[i];
210 DEBUG(5,("ldb_request dn=%s filter=%s\n",
211 req->basedn, ldb_filter_from_tree(call, req->tree)));
214 lreq.operation = LDB_REQ_SEARCH;
215 lreq.op.search.base = basedn;
216 lreq.op.search.scope = scope;
217 lreq.op.search.tree = req->tree;
218 lreq.op.search.attrs = attrs;
220 ldb_ret = get_ldb_controls(local_ctx, call->request->controls, &lreq.controls);
222 if (ldb_ret != LDB_SUCCESS) {
223 /* get_ldb_controls fails only on a critical internal error or when
224 * a control is defined as critical but it is not supported
229 ldb_ret = ldb_request(samdb, &lreq);
231 res = talloc_steal(samdb, lreq.op.search.res);
233 if (ldb_ret == LDB_SUCCESS) {
234 for (i = 0; i < res->count; i++) {
235 ent_r = ldapsrv_init_reply(call, LDAP_TAG_SearchResultEntry);
236 NT_STATUS_HAVE_NO_MEMORY(ent_r);
238 ent = &ent_r->msg->r.SearchResultEntry;
239 ent->dn = ldb_dn_linearize(ent_r, res->msgs[i]->dn);
240 ent->num_attributes = 0;
241 ent->attributes = NULL;
242 if (res->msgs[i]->num_elements == 0) {
245 ent->num_attributes = res->msgs[i]->num_elements;
246 ent->attributes = talloc_array(ent_r, struct ldb_message_element, ent->num_attributes);
247 NT_STATUS_HAVE_NO_MEMORY(ent->attributes);
248 for (j=0; j < ent->num_attributes; j++) {
249 ent->attributes[j].name = talloc_steal(ent->attributes, res->msgs[i]->elements[j].name);
250 ent->attributes[j].num_values = 0;
251 ent->attributes[j].values = NULL;
252 if (req->attributesonly && (res->msgs[i]->elements[j].num_values == 0)) {
255 ent->attributes[j].num_values = res->msgs[i]->elements[j].num_values;
256 ent->attributes[j].values = talloc_array(ent->attributes,
257 DATA_BLOB, ent->attributes[j].num_values);
258 NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values);
259 for (y=0; y < ent->attributes[j].num_values; y++) {
260 ent->attributes[j].values[y].length = res->msgs[i]->elements[j].values[y].length;
261 ent->attributes[j].values[y].data = talloc_steal(ent->attributes[j].values,
262 res->msgs[i]->elements[j].values[y].data);
266 ldapsrv_queue_reply(call, ent_r);
271 done_r = ldapsrv_init_reply(call, LDAP_TAG_SearchResultDone);
272 NT_STATUS_HAVE_NO_MEMORY(done_r);
274 done = &done_r->msg->r.SearchResultDone;
276 done->referral = NULL;
278 if (ldb_ret == LDB_SUCCESS) {
279 if (res->count >= success_limit) {
280 DEBUG(10,("SearchRequest: results: [%d]\n", res->count));
281 result = LDAP_SUCCESS;
283 } else if (res->count == 0) {
284 DEBUG(10,("SearchRequest: no results\n"));
285 result = LDAP_NO_SUCH_OBJECT;
286 errstr = ldb_errstring(samdb);
289 done_r->msg->controls = (struct ldap_Control **)(res->controls);
292 DEBUG(10,("SearchRequest: error\n"));
293 result = map_ldb_error(samdb, ldb_ret, &errstr);
296 done->resultcode = result;
297 done->errormessage = (errstr?talloc_strdup(done_r, errstr):NULL);
299 talloc_free(local_ctx);
301 ldapsrv_queue_reply(call, done_r);
305 static NTSTATUS ldapsrv_ModifyRequest(struct ldapsrv_call *call)
307 struct ldap_ModifyRequest *req = &call->request->r.ModifyRequest;
308 struct ldap_Result *modify_result;
309 struct ldapsrv_reply *modify_reply;
311 struct ldb_context *samdb = call->conn->ldb;
312 struct ldb_message *msg = NULL;
314 const char *errstr = NULL;
315 int result = LDAP_SUCCESS;
319 DEBUG(10, ("ModifyRequest"));
320 DEBUGADD(10, (" dn: %s", req->dn));
322 local_ctx = talloc_named(call, 0, "ModifyRequest local memory context");
323 NT_STATUS_HAVE_NO_MEMORY(local_ctx);
325 dn = ldb_dn_explode(local_ctx, req->dn);
326 VALID_DN_SYNTAX(dn, 1);
328 DEBUG(10, ("ModifyRequest: dn: [%s]\n", req->dn));
330 msg = talloc(local_ctx, struct ldb_message);
331 NT_STATUS_HAVE_NO_MEMORY(msg);
334 msg->private_data = NULL;
335 msg->num_elements = 0;
336 msg->elements = NULL;
338 if (req->num_mods > 0) {
339 msg->num_elements = req->num_mods;
340 msg->elements = talloc_array(msg, struct ldb_message_element, req->num_mods);
341 NT_STATUS_HAVE_NO_MEMORY(msg->elements);
343 for (i=0; i < msg->num_elements; i++) {
344 msg->elements[i].name = discard_const_p(char, req->mods[i].attrib.name);
345 msg->elements[i].num_values = 0;
346 msg->elements[i].values = NULL;
348 switch (req->mods[i].type) {
350 result = LDAP_PROTOCOL_ERROR;
351 errstr = "Invalid LDAP_MODIFY_* type";
353 case LDAP_MODIFY_ADD:
354 msg->elements[i].flags = LDB_FLAG_MOD_ADD;
356 case LDAP_MODIFY_DELETE:
357 msg->elements[i].flags = LDB_FLAG_MOD_DELETE;
359 case LDAP_MODIFY_REPLACE:
360 msg->elements[i].flags = LDB_FLAG_MOD_REPLACE;
364 msg->elements[i].num_values = req->mods[i].attrib.num_values;
365 if (msg->elements[i].num_values > 0) {
366 msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values);
367 NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values);
369 for (j=0; j < msg->elements[i].num_values; j++) {
370 if (!(req->mods[i].attrib.values[j].length > 0)) {
372 errstr = "Empty attribute values are not allowed";
375 msg->elements[i].values[j].length = req->mods[i].attrib.values[j].length;
376 msg->elements[i].values[j].data = req->mods[i].attrib.values[j].data;
382 errstr = "No mods are not allowed";
387 modify_reply = ldapsrv_init_reply(call, LDAP_TAG_ModifyResponse);
388 NT_STATUS_HAVE_NO_MEMORY(modify_reply);
390 if (result == LDAP_SUCCESS) {
391 ldb_ret = ldb_modify(samdb, msg);
392 result = map_ldb_error(samdb, ldb_ret, &errstr);
395 modify_result = &modify_reply->msg->r.AddResponse;
396 modify_result->dn = NULL;
397 modify_result->resultcode = result;
398 modify_result->errormessage = (errstr?talloc_strdup(modify_reply, errstr):NULL);
399 modify_result->referral = NULL;
401 talloc_free(local_ctx);
403 ldapsrv_queue_reply(call, modify_reply);
408 static NTSTATUS ldapsrv_AddRequest(struct ldapsrv_call *call)
410 struct ldap_AddRequest *req = &call->request->r.AddRequest;
411 struct ldap_Result *add_result;
412 struct ldapsrv_reply *add_reply;
414 struct ldb_context *samdb = call->conn->ldb;
415 struct ldb_message *msg = NULL;
417 const char *errstr = NULL;
418 int result = LDAP_SUCCESS;
422 DEBUG(10, ("AddRequest"));
423 DEBUGADD(10, (" dn: %s", req->dn));
425 local_ctx = talloc_named(call, 0, "AddRequest local memory context");
426 NT_STATUS_HAVE_NO_MEMORY(local_ctx);
428 dn = ldb_dn_explode(local_ctx, req->dn);
429 VALID_DN_SYNTAX(dn,1);
431 DEBUG(10, ("AddRequest: dn: [%s]\n", req->dn));
433 msg = talloc(local_ctx, struct ldb_message);
434 NT_STATUS_HAVE_NO_MEMORY(msg);
437 msg->private_data = NULL;
438 msg->num_elements = 0;
439 msg->elements = NULL;
441 if (req->num_attributes > 0) {
442 msg->num_elements = req->num_attributes;
443 msg->elements = talloc_array(msg, struct ldb_message_element, msg->num_elements);
444 NT_STATUS_HAVE_NO_MEMORY(msg->elements);
446 for (i=0; i < msg->num_elements; i++) {
447 msg->elements[i].name = discard_const_p(char, req->attributes[i].name);
448 msg->elements[i].flags = 0;
449 msg->elements[i].num_values = 0;
450 msg->elements[i].values = NULL;
452 if (req->attributes[i].num_values > 0) {
453 msg->elements[i].num_values = req->attributes[i].num_values;
454 msg->elements[i].values = talloc_array(msg, struct ldb_val, msg->elements[i].num_values);
455 NT_STATUS_HAVE_NO_MEMORY(msg->elements[i].values);
457 for (j=0; j < msg->elements[i].num_values; j++) {
458 if (!(req->attributes[i].values[j].length > 0)) {
460 errstr = "Empty attribute values are not allowed";
463 msg->elements[i].values[j].length = req->attributes[i].values[j].length;
464 msg->elements[i].values[j].data = req->attributes[i].values[j].data;
468 errstr = "No attribute values are not allowed";
474 errstr = "No attributes are not allowed";
479 add_reply = ldapsrv_init_reply(call, LDAP_TAG_AddResponse);
480 NT_STATUS_HAVE_NO_MEMORY(add_reply);
482 if (result == LDAP_SUCCESS) {
483 ldb_ret = ldb_add(samdb, msg);
484 result = map_ldb_error(samdb, ldb_ret, &errstr);
487 add_result = &add_reply->msg->r.AddResponse;
488 add_result->dn = NULL;
489 add_result->resultcode = result;
490 add_result->errormessage = (errstr?talloc_strdup(add_reply,errstr):NULL);
491 add_result->referral = NULL;
493 talloc_free(local_ctx);
495 ldapsrv_queue_reply(call, add_reply);
500 static NTSTATUS ldapsrv_DelRequest(struct ldapsrv_call *call)
502 struct ldap_DelRequest *req = &call->request->r.DelRequest;
503 struct ldap_Result *del_result;
504 struct ldapsrv_reply *del_reply;
506 struct ldb_context *samdb = call->conn->ldb;
508 const char *errstr = NULL;
509 int result = LDAP_SUCCESS;
512 DEBUG(10, ("DelRequest"));
513 DEBUGADD(10, (" dn: %s", req->dn));
515 local_ctx = talloc_named(call, 0, "DelRequest local memory context");
516 NT_STATUS_HAVE_NO_MEMORY(local_ctx);
518 dn = ldb_dn_explode(local_ctx, req->dn);
519 VALID_DN_SYNTAX(dn,1);
521 DEBUG(10, ("DelRequest: dn: [%s]\n", req->dn));
524 del_reply = ldapsrv_init_reply(call, LDAP_TAG_DelResponse);
525 NT_STATUS_HAVE_NO_MEMORY(del_reply);
527 if (result == LDAP_SUCCESS) {
528 ldb_ret = ldb_delete(samdb, dn);
529 result = map_ldb_error(samdb, ldb_ret, &errstr);
532 del_result = &del_reply->msg->r.DelResponse;
533 del_result->dn = NULL;
534 del_result->resultcode = result;
535 del_result->errormessage = (errstr?talloc_strdup(del_reply,errstr):NULL);
536 del_result->referral = NULL;
538 talloc_free(local_ctx);
540 ldapsrv_queue_reply(call, del_reply);
544 static NTSTATUS ldapsrv_ModifyDNRequest(struct ldapsrv_call *call)
546 struct ldap_ModifyDNRequest *req = &call->request->r.ModifyDNRequest;
547 struct ldap_Result *modifydn;
548 struct ldapsrv_reply *modifydn_r;
550 struct ldb_context *samdb = call->conn->ldb;
551 struct ldb_dn *olddn, *newdn, *newrdn;
552 struct ldb_dn *parentdn = NULL;
553 const char *errstr = NULL;
554 int result = LDAP_SUCCESS;
557 DEBUG(10, ("ModifyDNRequrest"));
558 DEBUGADD(10, (" dn: %s", req->dn));
559 DEBUGADD(10, (" newrdn: %s", req->newrdn));
561 local_ctx = talloc_named(call, 0, "ModifyDNRequest local memory context");
562 NT_STATUS_HAVE_NO_MEMORY(local_ctx);
564 olddn = ldb_dn_explode(local_ctx, req->dn);
565 VALID_DN_SYNTAX(olddn, 2);
567 newrdn = ldb_dn_explode(local_ctx, req->newrdn);
568 VALID_DN_SYNTAX(newrdn, 1);
570 DEBUG(10, ("ModifyDNRequest: olddn: [%s]\n", req->dn));
571 DEBUG(10, ("ModifyDNRequest: newrdn: [%s]\n", req->newrdn));
573 /* we can't handle the rename if we should not remove the old dn */
574 if (!req->deleteolddn) {
575 result = LDAP_UNWILLING_TO_PERFORM;
576 errstr = "Old RDN must be deleted";
580 if (newrdn->comp_num > 1) {
581 result = LDAP_NAMING_VIOLATION;
582 errstr = "Error new RDN invalid";
586 if (req->newsuperior) {
587 parentdn = ldb_dn_explode(local_ctx, req->newsuperior);
588 VALID_DN_SYNTAX(parentdn, 0);
589 DEBUG(10, ("ModifyDNRequest: newsuperior: [%s]\n", req->newsuperior));
591 if (parentdn->comp_num < 1) {
592 result = LDAP_AFFECTS_MULTIPLE_DSAS;
593 errstr = "Error new Superior DN invalid";
599 parentdn = ldb_dn_get_parent(local_ctx, olddn);
600 NT_STATUS_HAVE_NO_MEMORY(parentdn);
603 newdn = ldb_dn_make_child(local_ctx, ldb_dn_get_rdn(local_ctx, newrdn), parentdn);
604 NT_STATUS_HAVE_NO_MEMORY(newdn);
607 modifydn_r = ldapsrv_init_reply(call, LDAP_TAG_ModifyDNResponse);
608 NT_STATUS_HAVE_NO_MEMORY(modifydn_r);
610 if (result == LDAP_SUCCESS) {
611 ldb_ret = ldb_rename(samdb, olddn, newdn);
612 result = map_ldb_error(samdb, ldb_ret, &errstr);
615 modifydn = &modifydn_r->msg->r.ModifyDNResponse;
617 modifydn->resultcode = result;
618 modifydn->errormessage = (errstr?talloc_strdup(modifydn_r,errstr):NULL);
619 modifydn->referral = NULL;
621 talloc_free(local_ctx);
623 ldapsrv_queue_reply(call, modifydn_r);
627 static NTSTATUS ldapsrv_CompareRequest(struct ldapsrv_call *call)
629 struct ldap_CompareRequest *req = &call->request->r.CompareRequest;
630 struct ldap_Result *compare;
631 struct ldapsrv_reply *compare_r;
633 struct ldb_context *samdb = call->conn->ldb;
634 struct ldb_result *res = NULL;
636 const char *attrs[1];
637 const char *errstr = NULL;
638 const char *filter = NULL;
639 int result = LDAP_SUCCESS;
642 DEBUG(10, ("CompareRequest"));
643 DEBUGADD(10, (" dn: %s", req->dn));
645 local_ctx = talloc_named(call, 0, "CompareRequest local_memory_context");
646 NT_STATUS_HAVE_NO_MEMORY(local_ctx);
648 dn = ldb_dn_explode(local_ctx, req->dn);
649 VALID_DN_SYNTAX(dn, 1);
651 DEBUG(10, ("CompareRequest: dn: [%s]\n", req->dn));
652 filter = talloc_asprintf(local_ctx, "(%s=%*s)", req->attribute,
653 (int)req->value.length, req->value.data);
654 NT_STATUS_HAVE_NO_MEMORY(filter);
656 DEBUGADD(10, ("CompareRequest: attribute: [%s]\n", filter));
661 compare_r = ldapsrv_init_reply(call, LDAP_TAG_CompareResponse);
662 NT_STATUS_HAVE_NO_MEMORY(compare_r);
664 if (result == LDAP_SUCCESS) {
665 ldb_ret = ldb_search(samdb, dn, LDB_SCOPE_BASE, filter, attrs, &res);
666 talloc_steal(samdb, res);
667 if (ldb_ret != LDB_SUCCESS) {
668 result = map_ldb_error(samdb, ldb_ret, &errstr);
669 DEBUG(10,("CompareRequest: error: %s\n", errstr));
670 } else if (res->count == 0) {
671 DEBUG(10,("CompareRequest: doesn't matched\n"));
672 result = LDAP_COMPARE_FALSE;
674 } else if (res->count == 1) {
675 DEBUG(10,("CompareRequest: matched\n"));
676 result = LDAP_COMPARE_TRUE;
678 } else if (res->count > 1) {
680 errstr = "too many objects match";
681 DEBUG(10,("CompareRequest: %d results: %s\n", res->count, errstr));
685 compare = &compare_r->msg->r.CompareResponse;
687 compare->resultcode = result;
688 compare->errormessage = (errstr?talloc_strdup(compare_r,errstr):NULL);
689 compare->referral = NULL;
691 talloc_free(local_ctx);
693 ldapsrv_queue_reply(call, compare_r);
697 static NTSTATUS ldapsrv_AbandonRequest(struct ldapsrv_call *call)
699 /* struct ldap_AbandonRequest *req = &call->request.r.AbandonRequest;*/
700 DEBUG(10, ("AbandonRequest\n"));
704 static NTSTATUS ldapsrv_ExtendedRequest(struct ldapsrv_call *call)
706 /* struct ldap_ExtendedRequest *req = &call->request.r.ExtendedRequest;*/
707 struct ldapsrv_reply *reply;
709 DEBUG(10, ("Extended\n"));
711 reply = ldapsrv_init_reply(call, LDAP_TAG_ExtendedResponse);
713 return NT_STATUS_NO_MEMORY;
716 ZERO_STRUCT(reply->msg->r);
718 ldapsrv_queue_reply(call, reply);
722 NTSTATUS ldapsrv_do_call(struct ldapsrv_call *call)
724 switch(call->request->type) {
725 case LDAP_TAG_BindRequest:
726 return ldapsrv_BindRequest(call);
727 case LDAP_TAG_UnbindRequest:
728 return ldapsrv_UnbindRequest(call);
729 case LDAP_TAG_SearchRequest:
730 return ldapsrv_SearchRequest(call);
731 case LDAP_TAG_ModifyRequest:
732 return ldapsrv_ModifyRequest(call);
733 case LDAP_TAG_AddRequest:
734 return ldapsrv_AddRequest(call);
735 case LDAP_TAG_DelRequest:
736 return ldapsrv_DelRequest(call);
737 case LDAP_TAG_ModifyDNRequest:
738 return ldapsrv_ModifyDNRequest(call);
739 case LDAP_TAG_CompareRequest:
740 return ldapsrv_CompareRequest(call);
741 case LDAP_TAG_AbandonRequest:
742 return ldapsrv_AbandonRequest(call);
743 case LDAP_TAG_ExtendedRequest:
744 return ldapsrv_ExtendedRequest(call);
746 return ldapsrv_unwilling(call, 2);