diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-09-24 17:20:55 -0700 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-02 18:57:08 +0200 |
commit | 2f211daa47d16eddb807f8cde00509f62be7fd1f (patch) | |
tree | 60674b319a1c429597fa86fdf3b9192595a37adf /source4/lib/ldb | |
parent | e6d82267454a4678484b62cd5b28527f845af84f (diff) | |
download | samba-2f211daa47d16eddb807f8cde00509f62be7fd1f.tar.gz samba-2f211daa47d16eddb807f8cde00509f62be7fd1f.tar.bz2 samba-2f211daa47d16eddb807f8cde00509f62be7fd1f.zip |
s4:ldb Don't allow modifcation of distinguishedName
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index 55acb6132d..7427b98163 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -621,8 +621,14 @@ int ltdb_modify_internal(struct ldb_module *module, struct ldb_val *vals; const char *dn; const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, el->name); - switch (msg->elements[i].flags & LDB_FLAG_MOD_MASK) { + if (ldb_attr_cmp(el->name, "distinguishedName") == 0) { + ldb_asprintf_errstring(ldb, "it is not permitted to perform a modify on distinguishedName (use rename instead): %s", + ldb_dn_get_linearized(msg->dn)); + return LDB_ERR_UNWILLING_TO_PERFORM; + } + + switch (msg->elements[i].flags & LDB_FLAG_MOD_MASK) { case LDB_FLAG_MOD_ADD: /* add this element to the message. fail if it |