diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-25 20:37:45 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-28 10:25:08 +1000 |
commit | 83fae5f23f3a7929a685bf4e92bb99191bb2abe3 (patch) | |
tree | 2dffaacd337d8bc1badb06b20366f2d1ac6a0cc9 /source4/dsdb/samdb/ldb_modules | |
parent | 0d810fceaff4f4320a34f55c44525cc07a71f4af (diff) | |
download | samba-83fae5f23f3a7929a685bf4e92bb99191bb2abe3.tar.gz samba-83fae5f23f3a7929a685bf4e92bb99191bb2abe3.tar.bz2 samba-83fae5f23f3a7929a685bf4e92bb99191bb2abe3.zip |
s4-dsdb: fixed searching for GUID based DNs between partitions
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/extended_dn_in.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c index e6b0220242..89ba7bb04b 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c @@ -255,6 +255,7 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req "wellKnownObjects", NULL }; + bool all_partitions = false; if (!ldb_dn_has_extended(dn)) { /* Move along there isn't anything to see here */ @@ -268,7 +269,7 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req wkguid_val = ldb_dn_get_extended_component(dn, "WKGUID"); if (sid_val) { - /* TODO: do a search over all partitions */ + all_partitions = true; base_dn = ldb_get_default_basedn(ldb_module_get_ctx(module)); base_dn_filter = talloc_asprintf(req, "(objectSid=%s)", ldb_binary_encode(req, *sid_val)); @@ -281,7 +282,7 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req } else if (guid_val) { - /* TODO: do a search over all partitions */ + all_partitions = true; base_dn = ldb_get_default_basedn(ldb_module_get_ctx(module)); base_dn_filter = talloc_asprintf(req, "(objectGUID=%s)", ldb_binary_encode(req, *guid_val)); @@ -360,6 +361,19 @@ static int extended_dn_in_fix(struct ldb_module *module, struct ldb_request *req return LDB_ERR_OPERATIONS_ERROR; } + if (all_partitions) { + struct ldb_search_options_control *control; + control = talloc(down_req, struct ldb_search_options_control); + control->search_options = 2; + ret = ldb_request_add_control(down_req, + LDB_CONTROL_SEARCH_OPTIONS_OID, + true, control); + if (ret != LDB_SUCCESS) { + ldb_oom(ldb_module_get_ctx(module)); + return ret; + } + } + /* perform the search */ return ldb_next_request(module, down_req); } |