From 5630e25a35ea95ca848281933a5a3a96306986a4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 17 Jul 2012 11:10:12 +1000 Subject: s4-dsdb: Allow dbcheck to correct an incorrect instanceType --- source4/dsdb/samdb/ldb_modules/instancetype.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/instancetype.c b/source4/dsdb/samdb/ldb_modules/instancetype.c index d743d4fb30..7bf95f3180 100644 --- a/source4/dsdb/samdb/ldb_modules/instancetype.c +++ b/source4/dsdb/samdb/ldb_modules/instancetype.c @@ -136,10 +136,12 @@ static int instancetype_mod(struct ldb_module *module, struct ldb_request *req) el = ldb_msg_find_element(req->op.mod.message, "instanceType"); if (el != NULL) { - ldb_set_errstring(ldb, "instancetype: the 'instanceType' attribute can never be changed!"); - return LDB_ERR_CONSTRAINT_VIOLATION; + /* Except to allow dbcheck to fix things, this must never be modified */ + if (!ldb_request_get_control(req, DSDB_CONTROL_DBCHECK)) { + ldb_set_errstring(ldb, "instancetype: the 'instanceType' attribute can never be changed!"); + return LDB_ERR_CONSTRAINT_VIOLATION; + } } - return ldb_next_request(module, req); } -- cgit