summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-07 20:31:22 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-07 20:31:22 +0200
commita75d271373dbbff973544865c2c9715510d67669 (patch)
treed1ac3104dae7083dae95007823905faf5137a9c9 /source4/lib/ldb/modules
parent9a747d500fad699038ecf75615c680a9fd9e4cc7 (diff)
downloadsamba-a75d271373dbbff973544865c2c9715510d67669.tar.gz
samba-a75d271373dbbff973544865c2c9715510d67669.tar.bz2
samba-a75d271373dbbff973544865c2c9715510d67669.zip
s4:rdn_name LDB module - move the "distinguishedName" write prevent check here
In my eyes it fits better here than in the TDB backend code.
Diffstat (limited to 'source4/lib/ldb/modules')
-rw-r--r--source4/lib/ldb/modules/rdn_name.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index 38a1b6f583..5dc122f254 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -348,6 +348,12 @@ static int rdn_name_modify(struct ldb_module *module, struct ldb_request *req)
return ldb_next_request(module, req);
}
+ if (ldb_msg_find_element(req->op.mod.message, "distinguishedName")) {
+ ldb_asprintf_errstring(ldb, "Modify of 'distinguishedName' on %s not permitted, must use 'rename' operation instead",
+ ldb_dn_get_linearized(req->op.mod.message->dn));
+ return LDB_ERR_CONSTRAINT_VIOLATION;
+ }
+
if (ldb_msg_find_element(req->op.mod.message, "name")) {
ldb_asprintf_errstring(ldb, "Modify of 'name' on %s not permitted, must use 'rename' operation instead",
ldb_dn_get_linearized(req->op.mod.message->dn));