1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

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>
This commit is contained in:
Andrew Tridgell
2011-08-19 17:36:22 +10:00
parent 1216649772
commit bcbb35b088
2 changed files with 8 additions and 0 deletions

View File

@ -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);

View File

@ -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) {