ldb: mark the location of a lot more ldb requests
authorAndrew Tridgell <tridge@samba.org>
Fri, 24 Sep 2010 19:50:13 +0000 (12:50 -0700)
committerAndrew Tridgell <tridge@samba.org>
Sat, 25 Sep 2010 17:38:45 +0000 (10:38 -0700)
28 files changed:
source4/dsdb/samdb/ldb_modules/descriptor.c
source4/dsdb/samdb/ldb_modules/extended_dn_in.c
source4/dsdb/samdb/ldb_modules/extended_dn_store.c
source4/dsdb/samdb/ldb_modules/instancetype.c
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/local_password.c
source4/dsdb/samdb/ldb_modules/new_partition.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
source4/dsdb/samdb/ldb_modules/objectguid.c
source4/dsdb/samdb/ldb_modules/operational.c
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/partition_init.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/proxy.c
source4/dsdb/samdb/ldb_modules/ranged_results.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/resolve_oids.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/samba3sid.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/ldb_modules/schema_data.c
source4/dsdb/samdb/ldb_modules/schema_load.c
source4/dsdb/samdb/ldb_modules/show_deleted.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/dsdb/samdb/ldb_modules/subtree_rename.c
source4/dsdb/samdb/ldb_modules/update_keytab.c
source4/dsdb/samdb/ldb_modules/util.c

index 03e445e73ce2d238a720be026800c7953532c59a..959a7d8cd119fe13bb38a0d9ea3f5c33e160eb94 100644 (file)
@@ -645,6 +645,7 @@ static int descriptor_do_mod(struct descriptor_context *ac)
                                ac->req->controls,
                                ac, descriptor_op_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(mod_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -744,6 +745,7 @@ static int descriptor_do_add(struct descriptor_context *ac)
                                        ac->req->controls,
                                        ac, descriptor_op_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(add_req);
                if (ret != LDB_SUCCESS) {
                        return ret;
                }
@@ -755,6 +757,7 @@ static int descriptor_do_add(struct descriptor_context *ac)
                                   NULL,
                                   ac, get_search_oc_callback,
                                   ac->req);
+               LDB_REQ_SET_LOCATION(search_req);
                if (ret != LDB_SUCCESS) {
                        return ret;
                }
@@ -820,6 +823,7 @@ static int descriptor_change(struct ldb_module *module, struct ldb_request *req)
                                   NULL,
                                   ac, get_search_callback,
                                   req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 3dec685678ebfca1dffabf884feb44cb6105111e..78f0426ce98182a80aee00d2b0a2e79d00cf9968 100644 (file)
@@ -212,6 +212,7 @@ static int extended_base_callback(struct ldb_request *req, struct ldb_reply *are
                                                ac->req->controls,
                                                ac, extended_final_callback, 
                                                ac->req);
+                       LDB_REQ_SET_LOCATION(down_req);
                        break;
                }
                case LDB_DELETE:
@@ -221,6 +222,7 @@ static int extended_base_callback(struct ldb_request *req, struct ldb_reply *are
                                                ac->req->controls,
                                                ac, extended_final_callback, 
                                                ac->req);
+                       LDB_REQ_SET_LOCATION(down_req);
                        break;
                case LDB_RENAME:
                        ret = ldb_build_rename_req(&down_req,
@@ -230,6 +232,7 @@ static int extended_base_callback(struct ldb_request *req, struct ldb_reply *are
                                                   ac->req->controls,
                                                   ac, extended_final_callback, 
                                                   ac->req);
+                       LDB_REQ_SET_LOCATION(down_req);
                        break;
                default:
                        return ldb_module_done(ac->req, NULL, NULL, LDB_ERR_OPERATIONS_ERROR);
@@ -358,6 +361,7 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req
                                           NULL,
                                           ac, extended_base_callback,
                                           req);
+               LDB_REQ_SET_LOCATION(down_req);
                if (ret != LDB_SUCCESS) {
                        return ldb_operr(ldb_module_get_ctx(module));
                }
index 3f5f451f9467acf9af246716175131665b7ae3a8..15af268a8fc554042a9703f1e8b81f0057703958 100644 (file)
@@ -269,7 +269,7 @@ static int extended_store_replace(struct extended_dn_context *ac,
                                   ac->ldb, os, os->dsdb_dn->dn, LDB_SCOPE_BASE, NULL, 
                                   attrs, NULL, os, extended_replace_dn,
                                   ac->req);
-
+       LDB_REQ_SET_LOCATION(os->search_req);
        if (ret != LDB_SUCCESS) {
                talloc_free(os);
                return ret;
@@ -337,6 +337,7 @@ static int extended_dn_add(struct ldb_module *module, struct ldb_request *req)
                        }
                   
                        ret = ldb_build_add_req(&ac->new_req, ac->ldb, ac, msg, req->controls, ac, extended_final_callback, req);
+                       LDB_REQ_SET_LOCATION(ac->new_req);
                        if (ret != LDB_SUCCESS) {
                                return ret;
                        }
@@ -412,6 +413,7 @@ static int extended_dn_modify(struct ldb_module *module, struct ldb_request *req
                        }
                   
                        ret = ldb_build_mod_req(&ac->new_req, ac->ldb, ac, msg, req->controls, ac, extended_final_callback, req);
+                       LDB_REQ_SET_LOCATION(ac->new_req);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(ac);
                                return ret;
index 0a11bccbca0c784ba6326acfb5794b2777186c2b..5032462196269e304cb07cb5e8e8becc97a17292 100644 (file)
@@ -142,7 +142,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
                                        ac->req->controls,
                                        ac, it_add_callback,
                                        ac->req);
-               
+               LDB_REQ_SET_LOCATION(ac->add_req);
                if (ret != LDB_SUCCESS) {
                        return ret;
                }
@@ -172,6 +172,7 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                req, dsdb_next_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 29f9d0d697f7ed329d9b429c477c190443b7ae3f..b09d0cb148d203f2b5e08f550ee935aab5ecb024 100644 (file)
@@ -563,6 +563,7 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques
                                           NULL,
                                           ac, la_mod_search_callback,
                                           req);
+               LDB_REQ_SET_LOCATION(search_req);
 
                /* We need to figure out our own extended DN, to fill in as the backlink target */
                if (ret == LDB_SUCCESS) {
@@ -853,6 +854,7 @@ static int la_add_callback(struct ldb_request *req, struct ldb_reply *ares)
                                           NULL,
                                           ac, la_mod_search_callback,
                                           ac->req);
+               LDB_REQ_SET_LOCATION(search_req);
 
                if (ret == LDB_SUCCESS) {
                        ret = ldb_request_add_control(search_req,
@@ -891,6 +893,7 @@ static int la_down_req(struct la_context *ac)
                                        ac->req->controls,
                                        ac, la_add_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(down_req);
                break;
        case LDB_MODIFY:
                ret = ldb_build_mod_req(&down_req, ldb, ac,
@@ -898,6 +901,7 @@ static int la_down_req(struct la_context *ac)
                                        ac->req->controls,
                                        ac, la_mod_del_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(down_req);
                break;
        default:
                ret = LDB_ERR_OPERATIONS_ERROR;
index 022a6dc98dfe9f776262c3f993c0811234bd139b..359a3d0e052c57c291ae4639aef2dc95a1a0486a 100644 (file)
@@ -241,6 +241,7 @@ static int local_password_add(struct ldb_module *module, struct ldb_request *req
                                req->controls,
                                ac, lpdb_add_callback,
                                req);
+       LDB_REQ_SET_LOCATION(remote_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -284,6 +285,7 @@ static int lpdb_add_callback(struct ldb_request *req,
                                NULL,
                                ac, lpdb_local_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(local_req);
        if (ret != LDB_SUCCESS) {
                return ldb_module_done(ac->req, NULL, NULL, ret);
        }
@@ -369,6 +371,7 @@ static int local_password_modify(struct ldb_module *module, struct ldb_request *
                                req->controls,
                                ac, lpdb_modify_callabck,
                                req);
+       LDB_REQ_SET_LOCATION(remote_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -415,6 +418,7 @@ static int lpdb_modify_callabck(struct ldb_request *req,
                                   NULL,
                                   ac, lpdb_mod_search_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
@@ -523,6 +527,7 @@ static int lpdb_mod_search_callback(struct ldb_request *req,
                                        NULL,
                                        ac, lpdb_local_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(local_req);
                if (ret != LDB_SUCCESS) {
                        return ldb_module_done(ac->req, NULL, NULL, ret);
                }
@@ -580,6 +585,7 @@ static int local_password_delete(struct ldb_module *module,
                                req->controls,
                                ac, lpdb_delete_callabck,
                                req);
+       LDB_REQ_SET_LOCATION(remote_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -626,6 +632,7 @@ static int lpdb_delete_callabck(struct ldb_request *req,
                                   NULL,
                                   ac, lpdb_del_search_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ldb_module_done(ac->req, NULL, NULL,
                                        LDB_ERR_OPERATIONS_ERROR);
@@ -731,6 +738,7 @@ static int lpdb_del_search_callback(struct ldb_request *req,
                                        NULL,
                                        ac, lpdb_local_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(local_req);
                if (ret != LDB_SUCCESS) {
                        return ldb_module_done(ac->req, NULL, NULL, ret);
                }
@@ -769,6 +777,7 @@ static int lpdb_local_search(struct lpdb_context *ac)
                                   NULL,
                                   ac, lpdb_local_search_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(local_req);
        if (ret != LDB_SUCCESS) {
                return ldb_operr(ldb);
        }
index 33da2a445b6981acc03a8c35761a881a0c5c6e61..8e63eac40cba3fb255c3cd2d973fdd56f42513d6 100644 (file)
@@ -123,6 +123,7 @@ static int np_part_search_callback(struct ldb_request *req, struct ldb_reply *ar
                                     ldb, ac, DSDB_EXTENDED_CREATE_PARTITION_OID, ex_op, 
                                     NULL, ac, np_part_mod_callback, req);
        
+       LDB_REQ_SET_LOCATION(ac->part_add);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -182,6 +183,7 @@ static int new_partition_add(struct ldb_module *module, struct ldb_request *req)
                                           LDB_SCOPE_BASE, NULL, no_attrs, req->controls, ac, 
                                           np_part_search_callback,
                                           req);
+               LDB_REQ_SET_LOCATION(ac->search_req);
                if (ret != LDB_SUCCESS) {
                        return ret;
                }
index 005f0f282002bda750fda166a359f0a717cfb505..7541e1d03d9c8b56ebf4bf65f603b04f34d4d3d8 100644 (file)
@@ -423,6 +423,7 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
                                   NULL,
                                   ac, get_search_callback,
                                   req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -739,6 +740,7 @@ static int objectclass_do_add(struct oc_context *ac)
                                ac->req->controls,
                                ac, oc_op_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(add_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -804,6 +806,7 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
                                req->controls, ac,
                                oc_changes ? oc_modify_callback : oc_op_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -853,6 +856,7 @@ static int oc_modify_callback(struct ldb_request *req, struct ldb_reply *ares)
                                   attrs, NULL, 
                                   ac, get_search_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ldb_module_done(ac->req, NULL, NULL, ret);
        }
@@ -1097,6 +1101,7 @@ static int objectclass_do_mod(struct oc_context *ac)
                                ac->req->controls,
                                ac, oc_op_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(mod_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -1144,6 +1149,7 @@ static int objectclass_rename(struct ldb_module *module, struct ldb_request *req
                                   attrs, NULL,
                                   ac, get_search_callback,
                                   req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -1195,6 +1201,7 @@ static int objectclass_do_rename(struct oc_context *ac)
                                   attrs, NULL,
                                   ac, get_search_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -1311,6 +1318,7 @@ static int objectclass_do_rename2(struct oc_context *ac)
                                   ac->req->controls,
                                   ac, oc_op_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(rename_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -1358,6 +1366,7 @@ static int objectclass_delete(struct ldb_module *module, struct ldb_request *req
                                   attrs, NULL,
                                   ac, get_search_callback,
                                   req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 555295a6f4e7bfed7a07653aa11c57eaf4020dd1..2f43cc2416c26c53a47d847217769ab19d1bf024 100644 (file)
@@ -147,10 +147,12 @@ static int attr_handler(struct oc_context *ac)
                ret = ldb_build_add_req(&child_req, ldb, ac,
                                        msg, ac->req->controls,
                                        ac, oc_op_callback, ac->req);
+               LDB_REQ_SET_LOCATION(child_req);
        } else {
                ret = ldb_build_mod_req(&child_req, ldb, ac,
                                        msg, ac->req->controls,
                                        ac, oc_op_callback, ac->req);
+               LDB_REQ_SET_LOCATION(child_req);
        }
        if (ret != LDB_SUCCESS) {
                return ret;
@@ -342,6 +344,7 @@ static int oc_op_callback(struct ldb_request *req, struct ldb_reply *ares)
                                   LDB_SCOPE_BASE, "(objectClass=*)",
                                   NULL, NULL, ac,
                                   get_search_callback, ac->req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ldb_module_done(ac->req, NULL, NULL, ret);
        }
index 8ab49d14724cf171dba23a0c7f475ba4a0c26508..bf730d9da324286bf3c051f60cb275af865a3153 100644 (file)
@@ -199,6 +199,7 @@ static int objectguid_add(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                ac, og_op_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -257,6 +258,7 @@ static int objectguid_modify(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                ac, og_op_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index ee987d078ed0cb1ba0d5c91ad450c1e42c74ca9f..72feacfc1af98b4d74a3d8de0b01abfbf1146672 100644 (file)
@@ -820,6 +820,7 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
                                        req->controls,
                                        ac, operational_callback,
                                        req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ldb_operr(ldb);
        }
index 5065bd565ec180b1ce015b4b06e1442f19594007..68f31bce369548d7d3df6e23a307243fd83b4f8e 100644 (file)
@@ -258,6 +258,7 @@ static int partition_prep_request(struct partition_context *ac,
                                        ac->req->controls,
                                        ac, partition_req_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(req);
                break;
        case LDB_ADD:
                ret = ldb_build_add_req(&req, ldb_module_get_ctx(ac->module), ac->part_req,
@@ -265,6 +266,7 @@ static int partition_prep_request(struct partition_context *ac,
                                        ac->req->controls,
                                        ac, partition_req_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(req);
                break;
        case LDB_MODIFY:
                ret = ldb_build_mod_req(&req, ldb_module_get_ctx(ac->module), ac->part_req,
@@ -272,6 +274,7 @@ static int partition_prep_request(struct partition_context *ac,
                                        ac->req->controls,
                                        ac, partition_req_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(req);
                break;
        case LDB_DELETE:
                ret = ldb_build_del_req(&req, ldb_module_get_ctx(ac->module), ac->part_req,
@@ -279,6 +282,7 @@ static int partition_prep_request(struct partition_context *ac,
                                        ac->req->controls,
                                        ac, partition_req_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(req);
                break;
        case LDB_RENAME:
                ret = ldb_build_rename_req(&req, ldb_module_get_ctx(ac->module), ac->part_req,
@@ -287,6 +291,7 @@ static int partition_prep_request(struct partition_context *ac,
                                        ac->req->controls,
                                        ac, partition_req_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(req);
                break;
        case LDB_EXTENDED:
                ret = ldb_build_extended_req(&req, ldb_module_get_ctx(ac->module),
@@ -296,6 +301,7 @@ static int partition_prep_request(struct partition_context *ac,
                                        ac->req->controls,
                                        ac, partition_req_callback,
                                        ac->req);
+               LDB_REQ_SET_LOCATION(req);
                break;
        default:
                ldb_set_errstring(ldb_module_get_ctx(ac->module),
@@ -878,6 +884,7 @@ int partition_primary_sequence_number(struct ldb_module *module, TALLOC_CTX *mem
                                     res,
                                     ldb_extended_default_callback,
                                     NULL);
+       LDB_REQ_SET_LOCATION(treq);
        if (ret != LDB_SUCCESS) {
                talloc_free(res);
                return ret;
@@ -967,6 +974,7 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
                                                     res,
                                                     ldb_extended_default_callback,
                                                     NULL);
+                       LDB_REQ_SET_LOCATION(treq);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(res);
                                return ret;
@@ -1024,6 +1032,7 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
                                             res,
                                             ldb_extended_default_callback,
                                             NULL);
+               LDB_REQ_SET_LOCATION(treq);
                if (ret != LDB_SUCCESS) {
                        talloc_free(res);
                        return ret;
@@ -1068,6 +1077,7 @@ static int partition_sequence_number(struct ldb_module *module, struct ldb_reque
                                                     res,
                                                     ldb_extended_default_callback,
                                                     NULL);
+                       LDB_REQ_SET_LOCATION(treq);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(res);
                                return ret;
index 87c25430b5972d71faa8a2b6f81a46c8eb8e04f6..0ab8bada13ed61fec959482f5abbf40274755fb5 100644 (file)
@@ -562,6 +562,7 @@ static int new_partition_set_replicated_metadata(struct ldb_context *ldb,
                ret = ldb_build_add_req(&add_req, ldb, replicate_res, 
                                        replicate_res->msgs[0], NULL, NULL, 
                                        ldb_op_default_callback, last_req);
+               LDB_REQ_SET_LOCATION(add_req);
                last_req = add_req;
                if (ret != LDB_SUCCESS) {
                        /* return directly, this is a very unlikely error */
@@ -589,6 +590,7 @@ static int new_partition_set_replicated_metadata(struct ldb_context *ldb,
                        /* Build del request */
                        ret = ldb_build_del_req(&del_req, ldb, replicate_res, replicate_res->msgs[0]->dn, NULL, NULL, 
                                                ldb_op_default_callback, last_req);
+                       LDB_REQ_SET_LOCATION(del_req);
                        last_req = del_req;
                        if (ret != LDB_SUCCESS) {
                                /* return directly, this is a very unlikely error */
@@ -615,6 +617,7 @@ static int new_partition_set_replicated_metadata(struct ldb_context *ldb,
                        /* Build add request */
                        ret = ldb_build_add_req(&add_req, ldb, replicate_res, replicate_res->msgs[0], NULL, NULL, 
                                                ldb_op_default_callback, last_req);
+                       LDB_REQ_SET_LOCATION(add_req);
                        last_req = add_req;
                        if (ret != LDB_SUCCESS) {
                                /* return directly, this is a very unlikely error */
@@ -752,7 +755,7 @@ int partition_create(struct ldb_module *module, struct ldb_request *req)
                /* Perform modify on @PARTITION record */
                ret = ldb_build_mod_req(&mod_req, ldb, req, mod_msg, NULL, NULL, 
                                        ldb_op_default_callback, req);
-               
+               LDB_REQ_SET_LOCATION(mod_req);
                if (ret != LDB_SUCCESS) {
                        return ret;
                }
index 550f3c4e430afc0381b9316f5f240270488aae9c..488b8b7d338f4ed29c52ed6cd72cdf588e3fab3a 100644 (file)
@@ -2183,16 +2183,19 @@ static int build_domain_data_request(struct ph_context *ac)
                                              "minPwdAge",
                                              "minPwdLength",
                                              NULL };
+       int ret;
 
        ldb = ldb_module_get_ctx(ac->module);
 
-       return ldb_build_search_req(&ac->dom_req, ldb, ac,
-                                   ldb_get_default_basedn(ldb),
-                                   LDB_SCOPE_BASE,
-                                   NULL, attrs,
-                                   NULL,
-                                   ac, get_domain_data_callback,
-                                   ac->req);
+       ret = ldb_build_search_req(&ac->dom_req, ldb, ac,
+                                  ldb_get_default_basedn(ldb),
+                                  LDB_SCOPE_BASE,
+                                  NULL, attrs,
+                                  NULL,
+                                  ac, get_domain_data_callback,
+                                  ac->req);
+       LDB_REQ_SET_LOCATION(ac->dom_req);
+       return ret;
 }
 
 static int password_hash_add(struct ldb_module *module, struct ldb_request *req)
@@ -2370,6 +2373,7 @@ static int password_hash_add_do_add(struct ph_context *ac)
                                ac->req->controls,
                                ac, ph_op_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -2530,6 +2534,7 @@ static int password_hash_modify(struct ldb_module *module, struct ldb_request *r
                                req->controls,
                                ac, ph_modify_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -2675,7 +2680,7 @@ static int password_hash_mod_search_self(struct ph_context *ac)
                                   NULL,
                                   ac, ph_mod_search_callback,
                                   ac->req);
-
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -2796,6 +2801,7 @@ static int password_hash_mod_do_mod(struct ph_context *ac)
                                ac->req->controls,
                                ac, ph_op_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(mod_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 109afd22fe32bb73d4a0d9984c897cf9dc8c3117..1625fdf96b58d86b024ca43fe85b2d74143bf793 100644 (file)
@@ -360,7 +360,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
                                      req->controls,
                                      ac, proxy_search_callback,
                                      req);
-
+       LDB_REQ_SET_LOCATION(newreq);
        /* FIXME: warning, need a real event system hooked up for this to work properly,
         *        for now this makes the module *not* ASYNC */
        ret = ldb_request(proxy->upstream, newreq);
index a3a1aae9847bbc6276edfa779bd9a9adeb2bc6ca..3f1e09fbb69d465e597ce0408ec5906ad534566b 100644 (file)
@@ -234,6 +234,7 @@ static int rr_search(struct ldb_module *module, struct ldb_request *req)
                                              req->controls,
                                              ac, rr_search_callback,
                                              req);
+               LDB_REQ_SET_LOCATION(down_req);
                if (ret != LDB_SUCCESS) {
                        return ret;
                }
index 5fdcf9b1665efe8220501b82f1a864e391408bbd..ebd005e46ef5cc0c77b5f36853cacd61354a78e1 100644 (file)
@@ -969,6 +969,7 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req)
                                ac, replmd_op_callback,
                                req);
 
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                talloc_free(ac);
                return ret;
@@ -2204,6 +2205,7 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                ac, replmd_op_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                talloc_free(ac);
                return ret;
@@ -2274,7 +2276,7 @@ static int replmd_rename(struct ldb_module *module, struct ldb_request *req)
                                   ac->req->controls,
                                   ac, replmd_rename_callback,
                                   ac->req);
-
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                talloc_free(ac);
                return ret;
@@ -2333,7 +2335,7 @@ static int replmd_rename_callback(struct ldb_request *req, struct ldb_reply *are
                                req->controls,
                                ac, replmd_op_callback,
                                req);
-
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                talloc_free(ac);
                return ret;
@@ -2880,6 +2882,7 @@ static int replmd_replicated_apply_add(struct replmd_replicated_request *ar)
                                ar,
                                replmd_op_callback,
                                ar->req);
+       LDB_REQ_SET_LOCATION(change_req);
        if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
 
        return ldb_next_request(ar->module, change_req);
@@ -3144,6 +3147,7 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
                                ar,
                                replmd_op_callback,
                                ar->req);
+       LDB_REQ_SET_LOCATION(change_req);
        if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
 
        return ldb_next_request(ar->module, change_req);
@@ -3227,7 +3231,7 @@ static int replmd_replicated_apply_next(struct replmd_replicated_request *ar)
                                   ar,
                                   replmd_replicated_apply_search_callback,
                                   ar->req);
-
+       LDB_REQ_SET_LOCATION(search_req);
        ret = ldb_request_add_control(search_req, LDB_CONTROL_SHOW_DELETED_OID, true, NULL);
        if (ret != LDB_SUCCESS) {
                return ret;
@@ -3567,6 +3571,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a
                                ar,
                                replmd_replicated_uptodate_modify_callback,
                                ar->req);
+       LDB_REQ_SET_LOCATION(change_req);
        if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
 
        return ldb_next_request(ar->module, change_req);
@@ -3640,6 +3645,7 @@ static int replmd_replicated_uptodate_vector(struct replmd_replicated_request *a
                                   ar,
                                   replmd_replicated_uptodate_search_callback,
                                   ar->req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
 
        return ldb_next_request(ar->module, search_req);
index 3c9ebcd74560197e21680f2a4440d22a6c30c3b0..350364b1e98b9edf8fb2e9f6e0cc13430fd1c4e8 100644 (file)
@@ -557,6 +557,7 @@ static int resolve_oids_search(struct ldb_module *module, struct ldb_request *re
                                      req->controls,
                                      ac, resolve_oids_callback,
                                      req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -620,6 +621,7 @@ static int resolve_oids_add(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                ac, resolve_oids_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -684,6 +686,7 @@ static int resolve_oids_modify(struct ldb_module *module, struct ldb_request *re
                                req->controls,
                                ac, resolve_oids_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index c494cf521c9005d27f081c190ee5f41d54e4aa90..23b8f631d3a36b666bdbe78d917ad943bc628cb9 100644 (file)
@@ -115,6 +115,7 @@ static int expand_dn_in_message(struct ldb_module *module, struct ldb_message *m
                                   NULL,
                                   res, ldb_search_default_callback,
                                   req);
+       LDB_REQ_SET_LOCATION(req2);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -591,6 +592,7 @@ static int rootdse_search(struct ldb_module *module, struct ldb_request *req)
                                        NULL,/* for now skip the controls from the client */
                                        ac, rootdse_callback,
                                        req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index ef142002d1bbc4165dd4fbbe61a12a7f0b280986..749268468d95c68889828702724a0eeac054391d 100644 (file)
@@ -183,6 +183,7 @@ static int samba3sid_add(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                req, dsdb_next_callback,
                                req);
+       LDB_REQ_SET_LOCATION(new_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index e7e84b2e3b82151d9f869936fbb97f40eadc4c5b..269952a896b5c2bb622300bd776ec4f4208fffb4 100644 (file)
@@ -572,6 +572,7 @@ static int samldb_add_entry(struct samldb_ctx *ac)
                                ac->req->controls,
                                ac, samldb_add_entry_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index ec7e7b74b6dedb17ab30d50053ba2d05838ce70a..7b7d7d09ff5e643bcca137deb7d43830eab74219 100644 (file)
@@ -467,6 +467,7 @@ static int schema_data_search(struct ldb_module *module, struct ldb_request *req
                                        req->controls,
                                        search_context, schema_data_search_callback,
                                        req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ldb_operr(ldb);
        }
index 28c02099d34482cb8fc798eb512c3dbe22467b89..175fe9367d8997bfd37d4b96ee04daced3bec0dd 100644 (file)
@@ -79,6 +79,7 @@ struct dsdb_schema *dsdb_schema_refresh(struct ldb_module *module, struct dsdb_s
                                     res,
                                     ldb_extended_default_callback,
                                     NULL);
+       LDB_REQ_SET_LOCATION(treq);
        if (ret != LDB_SUCCESS) {
                talloc_free(res);
                return NULL;
index c189115599611ae107c87bf5e7c2a0cf05516dab..34807cf4b25dec2bb11947a48cb2de75309a1ba5 100644 (file)
@@ -82,6 +82,7 @@ static int show_deleted_search(struct ldb_module *module, struct ldb_request *re
                                      req->controls,
                                      req, dsdb_next_callback,
                                      req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 70185173f935cbb7c6929e2f6326fb862375b6d5..36c984f947335fb070bfed819a9c58e227ef844e 100644 (file)
@@ -861,6 +861,7 @@ static int entryuuid_sequence_number(struct ldb_module *module, struct ldb_reque
                                   NULL, contextCSN_attr, NULL,
                                   &seq_num, get_seq_callback,
                                   NULL);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 3f030509b0074c42d00281b992af7708672bce74..97330f898c46d212f3e54d1b5c35e1b41a0fb445 100644 (file)
@@ -132,6 +132,7 @@ static int subtree_rename_next_request(struct subtree_rename_context *ac)
                                   ac->req->controls,
                                   ac, subtree_rename_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -424,6 +425,7 @@ static int subtree_rename(struct ldb_module *module, struct ldb_request *req)
                                   ac, 
                                   subtree_rename_search_callback,
                                   req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 9db2c59baaa69dcd9c4179cc051e61b01afc101c..75c96fc57988c268036f25067898eaedec23a240 100644 (file)
@@ -176,6 +176,7 @@ static int ukt_del_op(struct update_kt_ctx *ac)
                                ac->req->controls,
                                ac, update_kt_op_callback,
                                ac->req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -249,6 +250,7 @@ static int ukt_search_modified(struct update_kt_ctx *ac)
                                   NULL,
                                   ac, ukt_search_modified_callback,
                                   ac->req);
+       LDB_REQ_SET_LOCATION(search_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -278,6 +280,7 @@ static int update_kt_add(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                ac, update_kt_op_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -307,6 +310,7 @@ static int update_kt_modify(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                ac, update_kt_op_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
@@ -353,6 +357,7 @@ static int update_kt_rename(struct ldb_module *module, struct ldb_request *req)
                                req->controls,
                                ac, update_kt_op_callback,
                                req);
+       LDB_REQ_SET_LOCATION(down_req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
index 03c301898e615b3f2b2031c4d255f8c396cd61b8..e6a0aeaf086ee042ae5fd52a6f99001f73aef8df 100644 (file)
@@ -61,6 +61,7 @@ int dsdb_module_search_dn(struct ldb_module *module,
                                   res,
                                   ldb_search_default_callback,
                                   NULL);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -152,6 +153,7 @@ int dsdb_module_search(struct ldb_module *module,
                                   res,
                                   ldb_search_default_callback,
                                   NULL);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -281,6 +283,7 @@ int dsdb_module_modify(struct ldb_module *module,
                                res,
                                ldb_modify_default_callback,
                                NULL);
+       LDB_REQ_SET_LOCATION(mod_req);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -339,6 +342,7 @@ int dsdb_module_rename(struct ldb_module *module,
                                   res,
                                   ldb_modify_default_callback,
                                   NULL);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -394,6 +398,7 @@ int dsdb_module_add(struct ldb_module *module,
                                res,
                                ldb_modify_default_callback,
                                NULL);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -449,6 +454,7 @@ int dsdb_module_del(struct ldb_module *module,
                                res,
                                ldb_modify_default_callback,
                                NULL);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -747,6 +753,7 @@ int dsdb_module_load_partition_usn(struct ldb_module *module, struct ldb_dn *dn,
                                   NULL,
                                   res, ldb_search_default_callback,
                                   NULL);
+       LDB_REQ_SET_LOCATION(req);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);
                return ret;
@@ -868,6 +875,7 @@ int dsdb_module_save_partition_usn(struct ldb_module *module, struct ldb_dn *dn,
                                res,
                                ldb_modify_default_callback,
                                NULL);
+       LDB_REQ_SET_LOCATION(req);
 again:
        if (ret != LDB_SUCCESS) {
                talloc_free(msg);
@@ -895,6 +903,7 @@ again:
                                        res,
                                        ldb_modify_default_callback,
                                        NULL);
+               LDB_REQ_SET_LOCATION(req);
                goto again;
        }