From 96600e5df185c5d3b774870c5339a8fcbf412ff5 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 5 Mar 2011 14:52:18 +0100 Subject: s4:simple_ldap_map LDB module - enhance current partition control checks Don't stop the server if it hasn't been filled in correctly. An LDB error should be enough. Modified by request of tridge: errorcodes changed to ERR_PROTOCOL_ERROR --- source4/dsdb/samdb/ldb_modules/simple_ldap_map.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/dsdb/samdb') diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c index 7412d29267..9ed3b414d6 100644 --- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c +++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c @@ -848,13 +848,17 @@ static int entryuuid_sequence_number(struct ldb_module *module, struct ldb_reque partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID); if (!partition_ctrl) { ldb_debug_set(ldb, LDB_DEBUG_FATAL, - "entryuuid_sequence_number: no current partition control found"); - return LDB_ERR_CONSTRAINT_VIOLATION; + "entryuuid_sequence_number: no current partition control found!"); + return LDB_ERR_PROTOCOL_ERROR; } partition = talloc_get_type(partition_ctrl->data, struct dsdb_control_current_partition); - SMB_ASSERT(partition && partition->version == DSDB_CONTROL_CURRENT_PARTITION_VERSION); + if ((partition == NULL) || (partition->version != DSDB_CONTROL_CURRENT_PARTITION_VERSION)) { + ldb_debug_set(ldb, LDB_DEBUG_FATAL, + "entryuuid_sequence_number: current partition control with wrong data!"); + return LDB_ERR_PROTOCOL_ERROR; + } ret = ldb_build_search_req(&search_req, ldb, req, partition->dn, LDB_SCOPE_BASE, -- cgit