summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-03-05 14:52:18 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-03-10 11:12:05 +0100
commit96600e5df185c5d3b774870c5339a8fcbf412ff5 (patch)
tree60d90f61f3c7802c2e22034561f0f1b5b580dbaf /source4/dsdb/samdb/ldb_modules
parente669295a37b9900c58707bfd5bce55197655ed95 (diff)
downloadsamba-96600e5df185c5d3b774870c5339a8fcbf412ff5.tar.gz
samba-96600e5df185c5d3b774870c5339a8fcbf412ff5.tar.bz2
samba-96600e5df185c5d3b774870c5339a8fcbf412ff5.zip
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
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/simple_ldap_map.c10
1 files changed, 7 insertions, 3 deletions
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,