summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-08-19 17:36:22 +1000
committerAndrew Tridgell <tridge@samba.org>2011-08-25 07:39:38 +1000
commitbcbb35b0888696db53f63f095e9bf07e493cb9ee (patch)
treed84cf7cca7f796cab8e810e0906f9351b656ad9b /source4/dsdb
parent12166497729252469ac3ffbf0495842cdc85cff0 (diff)
downloadsamba-bcbb35b0888696db53f63f095e9bf07e493cb9ee.tar.gz
samba-bcbb35b0888696db53f63f095e9bf07e493cb9ee.tar.bz2
samba-bcbb35b0888696db53f63f095e9bf07e493cb9ee.zip
s4-dsdb: assert that base DNs are used correctly
this will catch future programmer errors with incorrect base DNs Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/common/util.c3
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 22f092c127..ac380e9db6 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3875,6 +3875,9 @@ int dsdb_search(struct ldb_context *ldb,
char *expression = NULL;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
+ /* cross-partitions searches with a basedn break multi-domain support */
+ SMB_ASSERT(basedn == NULL || (dsdb_flags & DSDB_SEARCH_SEARCH_ALL_PARTITIONS) == 0);
+
res = talloc_zero(tmp_ctx, struct ldb_result);
if (!res) {
talloc_free(tmp_ctx);
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index dfb8600187..48600e718b 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -127,6 +127,8 @@ int dsdb_module_search_tree(struct ldb_module *module,
tmp_ctx = talloc_new(mem_ctx);
+ /* cross-partitions searches with a basedn break multi-domain support */
+ SMB_ASSERT(basedn == NULL || (dsdb_flags & DSDB_SEARCH_SEARCH_ALL_PARTITIONS) == 0);
res = talloc_zero(tmp_ctx, struct ldb_result);
if (!res) {
@@ -198,6 +200,9 @@ int dsdb_module_search(struct ldb_module *module,
char *expression;
struct ldb_parse_tree *tree;
+ /* cross-partitions searches with a basedn break multi-domain support */
+ SMB_ASSERT(basedn == NULL || (dsdb_flags & DSDB_SEARCH_SEARCH_ALL_PARTITIONS) == 0);
+
tmp_ctx = talloc_new(mem_ctx);
if (format) {