s4:dsdb Don't cast an ldb_val into a const char * for schema lookups
[ira/wip.git] / source4 / dsdb / schema / schema_convert_to_ol.c
index ebcb7ade59e3f73cb23ae253a14fead094c0d3f7..c0ab5c2af85f1afb5afaa598970f2fc969acbc27 100644 (file)
@@ -56,9 +56,11 @@ static char *print_schema_recursive(char *append_to_string, struct dsdb_schema *
                const char **must;
                const char **may;
                char *schema_entry = NULL;
-               const char *objectclass_name_as_list[] = {
-                       objectclass->lDAPDisplayName,
-                       NULL
+               struct ldb_val objectclass_name_as_ldb_val = data_blob_string_const(objectclass->lDAPDisplayName);
+               struct ldb_message_element objectclass_name_as_el = {
+                       .name = "objectClass",
+                       .num_values = 1,
+                       .values = &objectclass_name_as_ldb_val
                };
                int j;
                int attr_idx;
@@ -89,7 +91,7 @@ static char *print_schema_recursive(char *append_to_string, struct dsdb_schema *
                        }
                }
                
-               may = dsdb_full_attribute_list(mem_ctx, schema, objectclass_name_as_list, DSDB_SCHEMA_ALL_MAY);
+               may = dsdb_full_attribute_list(mem_ctx, schema, &objectclass_name_as_el, DSDB_SCHEMA_ALL_MAY);
 
                for (j=0; may && may[j]; j++) {
                        /* We might have been asked to remap this name, due to a conflict */ 
@@ -101,7 +103,7 @@ static char *print_schema_recursive(char *append_to_string, struct dsdb_schema *
                        }                                               
                }
 
-               must = dsdb_full_attribute_list(mem_ctx, schema, objectclass_name_as_list, DSDB_SCHEMA_ALL_MUST);
+               must = dsdb_full_attribute_list(mem_ctx, schema, &objectclass_name_as_el, DSDB_SCHEMA_ALL_MUST);
 
                for (j=0; must && must[j]; j++) {
                        /* We might have been asked to remap this name, due to a conflict */