summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-17 11:10:12 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-18 09:32:53 +0200
commit5630e25a35ea95ca848281933a5a3a96306986a4 (patch)
tree08341c0e831d57206f7942d8436961300b512557
parent96db13405bce8fa6d08b8b802439a606643e6db4 (diff)
downloadsamba-5630e25a35ea95ca848281933a5a3a96306986a4.tar.gz
samba-5630e25a35ea95ca848281933a5a3a96306986a4.tar.bz2
samba-5630e25a35ea95ca848281933a5a3a96306986a4.zip
s4-dsdb: Allow dbcheck to correct an incorrect instanceType
-rw-r--r--source4/dsdb/samdb/ldb_modules/instancetype.c8
1 files 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);
}