Revert "s4-dsdb: Remove strcasecmp() fallback in replmd_ldb_message_element_attid_sort"
[obnox/samba/samba-obnox.git] / source4 / dsdb / samdb / ldb_modules / repl_meta_data.c
index 98e60d7a8bf2c9d7e491672fda8232df8dae36c0..24dcc6f04dce79583fa5e78efeb904bcb51280df 100644 (file)
@@ -663,6 +663,13 @@ static int replmd_ldb_message_element_attid_sort(const struct ldb_message_elemen
        a1 = dsdb_attribute_by_lDAPDisplayName(schema, e1->name);
        a2 = dsdb_attribute_by_lDAPDisplayName(schema, e2->name);
 
+       /*
+        * TODO: remove this check, we should rely on e1 and e2 having valid attribute names
+        *       in the schema
+        */
+       if (!a1 || !a2) {
+               return strcasecmp(e1->name, e2->name);
+       }
        if (a1->attributeID_id == a2->attributeID_id) {
                return 0;
        }