diff options
Diffstat (limited to 'source4/dsdb/schema/schema_init.c')
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 41998a16db..6de87708c7 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -427,18 +427,34 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb d_printf("%s: %s == NULL\n", __location__, attr); \ return WERR_INVALID_PARAM; \ } \ - if (strict && _a->value_ctr.unicode_string.num_values != 1) { \ + if (strict && _a->value_ctr.data_blob.num_values != 1) { \ d_printf("%s: %s num_values == %u\n", __location__, attr, \ - _a->value_ctr.unicode_string.num_values); \ + _a->value_ctr.data_blob.num_values); \ return WERR_INVALID_PARAM; \ } \ - if (_a && _a->value_ctr.unicode_string.num_values >= 1) { \ - (p)->elem = talloc_steal(mem_ctx, _a->value_ctr.unicode_string.values[0].string);\ + if (_a && _a->value_ctr.data_blob.num_values >= 1) { \ + ssize_t _ret; \ + _ret = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, \ + _a->value_ctr.data_blob.values[0].data->data, \ + _a->value_ctr.data_blob.values[0].data->length, \ + (void **)discard_const(&(p)->elem)); \ + if (_ret == -1) { \ + DEBUG(0,("%s: invalid data!\n", attr)); \ + dump_data(0, \ + _a->value_ctr.data_blob.values[0].data->data, \ + _a->value_ctr.data_blob.values[0].data->length); \ + return WERR_FOOBAR; \ + } \ } else { \ (p)->elem = NULL; \ } \ } while (0) +#define GET_DN_DS(s, r, attr, mem_ctx, p, elem, strict) do { \ + /* TODO: ! */ \ + (p)->elem = NULL; \ +} while (0) + #define GET_BOOL_DS(s, r, attr, p, elem, strict) do { \ struct drsuapi_DsReplicaAttribute *_a; \ _a = dsdb_find_object_attr_name(s, r, attr, NULL); \ @@ -594,8 +610,8 @@ WERROR dsdb_class_from_drsuapi(struct dsdb_schema *schema, GET_UINT32_DS(schema, r, "objectClassCategory", obj, objectClassCategory); GET_STRING_DS(schema, r, "rDNAttID", mem_ctx, obj, rDNAttID, False); - GET_STRING_DS(schema, r, "defaultObjectCategory", mem_ctx, obj, defaultObjectCategory, True); - + GET_DN_DS(schema, r, "defaultObjectCategory", mem_ctx, obj, defaultObjectCategory, True); + GET_STRING_DS(schema, r, "subClassOf", mem_ctx, obj, subClassOf, True); obj->systemAuxiliaryClass = NULL; |