s4:repl_meta_data - also on delete operations the new RDN attribute has to be casefol...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 19 Sep 2010 18:34:08 +0000 (20:34 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Sep 2010 23:25:43 +0000 (09:25 +1000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 6ae8e928b0ec4dc0441536adc82a19a7e162ebff..1712c03feb116f5996fdda62b2c7217e6e02156d 100644 (file)
@@ -2713,11 +2713,20 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
        }
 
        if (deletion_state == OBJECT_NOT_DELETED) {
+               const struct dsdb_attribute *sa;
+
                /* work out what the new rdn value is, for updating the
                   rDN and name fields */
                new_rdn_value = ldb_dn_get_rdn_val(new_dn);
 
-               ret = ldb_msg_add_value(msg, strlower_talloc(tmp_ctx, rdn_name), new_rdn_value, &el);
+               sa = dsdb_attribute_by_lDAPDisplayName(schema, rdn_name);
+               if (!sa) {
+                       talloc_free(tmp_ctx);
+                       return LDB_ERR_OPERATIONS_ERROR;
+               }
+
+               ret = ldb_msg_add_value(msg, sa->lDAPDisplayName, new_rdn_value,
+                                       &el);
                if (ret != LDB_SUCCESS) {
                        talloc_free(tmp_ctx);
                        return ret;