summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-08-19 17:35:45 +1000
committerAndrew Tridgell <tridge@samba.org>2011-08-25 07:39:38 +1000
commit12166497729252469ac3ffbf0495842cdc85cff0 (patch)
tree2dfd1a05a6bc8d65cdb57fbbe97198ff26b6d7f3
parent171c3cdd4a506bfebdcb031d2130d7eb627d2d38 (diff)
downloadsamba-12166497729252469ac3ffbf0495842cdc85cff0.tar.gz
samba-12166497729252469ac3ffbf0495842cdc85cff0.tar.bz2
samba-12166497729252469ac3ffbf0495842cdc85cff0.zip
s4-dsdb: enforce NULL DN validity in partition module
windows does not allow a search on the empty DN except for rootDSE searches or for phantom_root searches (ie. with --cross-ncs). By enforcing this in Samba we make it more likely that our tests and utilities will work against windows Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index ba77ca0ad1..b2865487d2 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -542,6 +542,9 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req)
/* Search from the base DN */
if (ldb_dn_is_null(req->op.search.base)) {
+ if (!phantom_root) {
+ return ldb_error(ldb, LDB_ERR_NO_SUCH_OBJECT, "empty base DN");
+ }
return partition_send_all(module, ac, req);
}