s4:dsdb/repl/replicated_objects - Applicate also here the new "lDAPDisplayName" generator
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sat, 14 Nov 2009 19:14:45 +0000 (20:14 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 15 Nov 2009 13:26:41 +0000 (14:26 +0100)
Also here we've to be sure to generate the attribute correctly if it doesn't
exist yet.

source4/dsdb/repl/replicated_objects.c

index 020d5f1b0714a7a4e7add1c31230d67c82e6a669..043c620f523b20834f2df04b1c68209b1d43d91e 100644 (file)
@@ -153,7 +153,10 @@ static WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
                struct ldb_message_element *el;
                el = ldb_msg_find_element(msg, rdn_attr->lDAPDisplayName);
                if (!el) {
                struct ldb_message_element *el;
                el = ldb_msg_find_element(msg, rdn_attr->lDAPDisplayName);
                if (!el) {
-                       ret = ldb_msg_add_value(msg, rdn_attr->lDAPDisplayName, rdn_value, NULL);
+                       /* we assume that the RDN has prefix "CN" */
+                       ret = ldb_msg_add_string(msg, rdn_attr->lDAPDisplayName,
+                               samdb_cn_to_lDAPDisplayName(mem_ctx,
+                                       (const char *) rdn_value->data));
                        if (ret != LDB_SUCCESS) {
                                return WERR_FOOBAR;
                        }
                        if (ret != LDB_SUCCESS) {
                                return WERR_FOOBAR;
                        }