• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/samba-3.5.8/source4/lib/ldb/ldb_map/

Lines Matching refs:ac

185 static int map_add_do_local(struct map_context *ac);
186 static int map_modify_do_local(struct map_context *ac);
187 static int map_delete_do_local(struct map_context *ac);
188 static int map_rename_do_local(struct map_context *ac);
189 static int map_rename_do_fixup(struct map_context *ac);
202 struct map_context *ac;
205 ac = talloc_get_type(req->context, struct map_context);
206 ldb = ldb_module_get_ctx(ac->module);
209 return ldb_module_done(ac->req, NULL, NULL,
213 return ldb_module_done(ac->req, ares->controls,
221 if (ac->local_dn) {
224 return ldb_module_done(ac->req, NULL, NULL,
229 ac->local_dn = talloc_steal(ac, ares->message->dn);
234 switch (ac->req->operation) {
236 ret = map_modify_do_local(ac);
239 ret = map_delete_do_local(ac);
242 ret = map_rename_do_local(ac);
249 return ldb_module_done(ac->req, NULL, NULL,
264 struct map_context *ac,
268 * ac->search_req->op.search.attrs, so it must be static, as
274 tree = ldb_parse_tree(ac, "(" IS_MAPPED "=*)");
276 map_oom(ac->module);
280 *req = map_search_base_req(ac, dn, attrs, tree,
281 ac, map_search_self_callback);
293 struct map_context *ac;
296 ac = talloc_get_type(req->context, struct map_context);
297 ldb = ldb_module_get_ctx(ac->module);
300 return ldb_module_done(ac->req, NULL, NULL,
304 return ldb_module_done(ac->req, ares->controls,
310 return ldb_module_done(ac->req, NULL, NULL,
315 ret = ldb_next_remote_request(ac->module, ac->remote_req);
317 return ldb_module_done(ac->req, NULL, NULL,
328 struct map_context *ac;
330 ac = talloc_get_type(req->context, struct map_context);
331 ldb = ldb_module_get_ctx(ac->module);
334 return ldb_module_done(ac->req, NULL, NULL,
338 return ldb_module_done(ac->req, ares->controls,
344 return ldb_module_done(ac->req, NULL, NULL,
348 return ldb_module_done(ac->req, ares->controls,
363 struct map_context *ac;
386 ac = map_init_context(module, req);
387 if (ac == NULL) {
393 ac->local_msg = ldb_msg_new(ac);
394 if (ac->local_msg == NULL) {
398 ac->local_msg->dn = msg->dn;
401 remote_msg = ldb_msg_new(ac);
406 remote_msg->dn = ldb_dn_map_local(ac->module, remote_msg, msg->dn);
409 ldb_msg_partition(module, ac->local_msg, remote_msg, msg);
412 ret = ldb_build_add_req(&ac->remote_req, ldb,
413 ac, remote_msg,
415 ac, map_op_remote_callback,
421 if ((ac->local_msg->num_elements == 0) ||
422 ( ! map_check_local_db(ac->module))) {
424 return ldb_next_remote_request(ac->module, ac->remote_req);
429 dn = ldb_dn_alloc_linearized(ac->local_msg, remote_msg->dn);
430 if (ldb_msg_add_string(ac->local_msg, IS_MAPPED, dn) != 0) {
434 return map_add_do_local(ac);
438 static int map_add_do_local(struct map_context *ac)
444 ldb = ldb_module_get_ctx(ac->module);
447 ret = ldb_build_add_req(&local_req, ldb, ac,
448 ac->local_msg,
449 ac->req->controls,
450 ac,
452 ac->req);
456 return ldb_next_request(ac->module, local_req);
470 struct map_context *ac;
494 ac = map_init_context(module, req);
495 if (ac == NULL) {
500 ac->local_msg = ldb_msg_new(ac);
501 if (ac->local_msg == NULL) {
505 ac->local_msg->dn = msg->dn;
508 remote_msg = ldb_msg_new(ac->remote_req);
513 remote_msg->dn = ldb_dn_map_local(ac->module, remote_msg, msg->dn);
516 ldb_msg_partition(module, ac->local_msg, remote_msg, msg);
519 ret = ldb_build_mod_req(&ac->remote_req, ldb,
520 ac, remote_msg,
522 ac, map_op_remote_callback,
528 if ((ac->local_msg->num_elements == 0) ||
529 ( ! map_check_local_db(ac->module))) {
531 return ldb_next_remote_request(ac->module, ac->remote_req);
535 ret = map_search_self_req(&search_req, ac, msg->dn);
544 static int map_modify_do_local(struct map_context *ac)
551 ldb = ldb_module_get_ctx(ac->module);
553 if (ac->local_dn == NULL) {
557 if (ldb_msg_add_empty(ac->local_msg, IS_MAPPED,
561 dn = ldb_dn_alloc_linearized(ac->local_msg,
562 ac->remote_req->op.mod.message->dn);
563 if (ldb_msg_add_string(ac->local_msg, IS_MAPPED, dn) != 0) {
568 ret = ldb_build_add_req(&local_req, ldb, ac,
569 ac->local_msg,
570 ac->req->controls,
571 ac,
573 ac->req);
579 ret = ldb_build_mod_req(&local_req, ldb, ac,
580 ac->local_msg,
581 ac->req->controls,
582 ac,
584 ac->req);
590 return ldb_next_request(ac->module, local_req);
602 struct map_context *ac;
619 ac = map_init_context(module, req);
620 if (ac == NULL) {
625 ret = ldb_build_del_req(&ac->remote_req, ldb, ac,
626 ldb_dn_map_local(module, ac, req->op.del.dn),
628 ac,
636 if (!map_check_local_db(ac->module)) {
638 return ldb_next_remote_request(ac->module, ac->remote_req);
642 ret = map_search_self_req(&search_req, ac, req->op.del.dn);
652 static int map_delete_do_local(struct map_context *ac)
658 ldb = ldb_module_get_ctx(ac->module);
661 if (ac->local_dn == NULL) {
663 return ldb_next_remote_request(ac->module, ac->remote_req);
667 ret = ldb_build_del_req(&local_req, ldb, ac,
668 ac->req->op.del.dn,
669 ac->req->controls,
670 ac,
672 ac->req);
676 return ldb_next_request(ac->module, local_req);
688 struct map_context *ac;
712 ac = map_init_context(module, req);
713 if (ac == NULL) {
718 ret = ldb_build_rename_req(&ac->remote_req, ldb, ac,
719 ldb_dn_map_local(module, ac, req->op.rename.olddn),
720 ldb_dn_map_local(module, ac, req->op.rename.newdn),
722 ac, map_op_remote_callback,
729 if (!map_check_local_db(ac->module)) {
731 return ldb_next_remote_request(ac->module, ac->remote_req);
735 ret = map_search_self_req(&search_req, ac, req->op.rename.olddn);
745 static int map_rename_do_local(struct map_context *ac)
751 ldb = ldb_module_get_ctx(ac->module);
754 if (ac->local_dn == NULL) {
756 return ldb_next_remote_request(ac->module, ac->remote_req);
760 ret = ldb_build_rename_req(&local_req, ldb, ac,
761 ac->req->op.rename.olddn,
762 ac->req->op.rename.newdn,
763 ac->req->controls,
764 ac,
766 ac->req);
771 return ldb_next_request(ac->module, local_req);
778 struct map_context *ac;
781 ac = talloc_get_type(req->context, struct map_context);
782 ldb = ldb_module_get_ctx(ac->module);
785 return ldb_module_done(ac->req, NULL, NULL,
789 return ldb_module_done(ac->req, ares->controls,
795 return ldb_module_done(ac->req, NULL, NULL,
800 ret = map_rename_do_fixup(ac);
802 return ldb_module_done(ac->req, NULL, NULL,
810 static int map_rename_do_fixup(struct map_context *ac)
816 local_req = map_build_fixup_req(ac,
817 ac->req->op.rename.newdn,
818 ac->remote_req->op.rename.newdn,
819 ac,
825 return ldb_next_request(ac->module, local_req);