summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/schema/schema_init.c66
-rw-r--r--source4/dsdb/schema/schema_syntax.c270
-rw-r--r--source4/libnet/libnet_become_dc.c140
-rw-r--r--source4/librpc/idl/drsuapi.idl81
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c8
-rw-r--r--source4/torture/rpc/dssync.c6
6 files changed, 254 insertions, 317 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index c85988d938..6caefef9a7 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -427,22 +427,22 @@ 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.data_blob.num_values != 1) { \
+ if (strict && _a->value_ctr.num_values != 1) { \
d_printf("%s: %s num_values == %u\n", __location__, attr, \
- _a->value_ctr.data_blob.num_values); \
+ _a->value_ctr.num_values); \
return WERR_INVALID_PARAM; \
} \
- if (_a && _a->value_ctr.data_blob.num_values >= 1) { \
+ if (_a && _a->value_ctr.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, \
+ _a->value_ctr.values[0].blob->data, \
+ _a->value_ctr.values[0].blob->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); \
+ _a->value_ctr.values[0].blob->data, \
+ _a->value_ctr.values[0].blob->length); \
return WERR_FOOBAR; \
} \
} else { \
@@ -457,20 +457,20 @@ 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.data_blob.num_values != 1) { \
+ if (strict && _a->value_ctr.num_values != 1) { \
d_printf("%s: %s num_values == %u\n", __location__, attr, \
- _a->value_ctr.data_blob.num_values); \
+ _a->value_ctr.num_values); \
return WERR_INVALID_PARAM; \
} \
- if (strict && !_a->value_ctr.data_blob.values[0].data) { \
+ if (strict && !_a->value_ctr.values[0].blob) { \
d_printf("%s: %s data == NULL\n", __location__, attr); \
return WERR_INVALID_PARAM; \
} \
- if (_a && _a->value_ctr.data_blob.num_values >= 1 \
- && _a->value_ctr.data_blob.values[0].data) { \
+ if (_a && _a->value_ctr.num_values >= 1 \
+ && _a->value_ctr.values[0].blob) { \
struct drsuapi_DsReplicaObjectIdentifier3 _id3; \
NTSTATUS _nt_status; \
- _nt_status = ndr_pull_struct_blob_all(_a->value_ctr.data_blob.values[0].data, \
+ _nt_status = ndr_pull_struct_blob_all(_a->value_ctr.values[0].blob, \
mem_ctx, &_id3,\
(ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3);\
if (!NT_STATUS_IS_OK(_nt_status)) { \
@@ -489,24 +489,24 @@ 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.data_blob.num_values != 1) { \
+ if (strict && _a->value_ctr.num_values != 1) { \
d_printf("%s: %s num_values == %u\n", __location__, attr, \
- _a->value_ctr.data_blob.num_values); \
+ _a->value_ctr.num_values); \
return WERR_INVALID_PARAM; \
} \
- if (strict && !_a->value_ctr.data_blob.values[0].data) { \
+ if (strict && !_a->value_ctr.values[0].blob) { \
d_printf("%s: %s data == NULL\n", __location__, attr); \
return WERR_INVALID_PARAM; \
} \
- if (strict && _a->value_ctr.data_blob.values[0].data->length != 4) { \
+ if (strict && _a->value_ctr.values[0].blob->length != 4) { \
d_printf("%s: %s length == %u\n", __location__, attr, \
- _a->value_ctr.data_blob.values[0].data->length); \
+ _a->value_ctr.values[0].blob->length); \
return WERR_INVALID_PARAM; \
} \
- if (_a && _a->value_ctr.data_blob.num_values >= 1 \
- && _a->value_ctr.data_blob.values[0].data \
- && _a->value_ctr.data_blob.values[0].data->length == 4) { \
- (p)->elem = (IVAL(_a->value_ctr.data_blob.values[0].data->data,0)?True:False);\
+ if (_a && _a->value_ctr.num_values >= 1 \
+ && _a->value_ctr.values[0].blob \
+ && _a->value_ctr.values[0].blob->length == 4) { \
+ (p)->elem = (IVAL(_a->value_ctr.values[0].blob->data,0)?True:False);\
} else { \
(p)->elem = False; \
} \
@@ -515,10 +515,10 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
#define GET_UINT32_DS(s, r, attr, p, elem) do { \
struct drsuapi_DsReplicaAttribute *_a; \
_a = dsdb_find_object_attr_name(s, r, attr, NULL); \
- if (_a && _a->value_ctr.data_blob.num_values >= 1 \
- && _a->value_ctr.data_blob.values[0].data \
- && _a->value_ctr.data_blob.values[0].data->length == 4) { \
- (p)->elem = IVAL(_a->value_ctr.data_blob.values[0].data->data,0);\
+ if (_a && _a->value_ctr.num_values >= 1 \
+ && _a->value_ctr.values[0].blob \
+ && _a->value_ctr.values[0].blob->length == 4) { \
+ (p)->elem = IVAL(_a->value_ctr.values[0].blob->data,0);\
} else { \
(p)->elem = 0; \
} \
@@ -527,11 +527,11 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
#define GET_GUID_DS(s, r, attr, mem_ctx, p, elem) do { \
struct drsuapi_DsReplicaAttribute *_a; \
_a = dsdb_find_object_attr_name(s, r, attr, NULL); \
- if (_a && _a->value_ctr.data_blob.num_values >= 1 \
- && _a->value_ctr.data_blob.values[0].data \
- && _a->value_ctr.data_blob.values[0].data->length == 16) { \
+ if (_a && _a->value_ctr.num_values >= 1 \
+ && _a->value_ctr.values[0].blob \
+ && _a->value_ctr.values[0].blob->length == 16) { \
NTSTATUS _nt_status; \
- _nt_status = ndr_pull_struct_blob_all(_a->value_ctr.data_blob.values[0].data, \
+ _nt_status = ndr_pull_struct_blob_all(_a->value_ctr.values[0].blob, \
mem_ctx, &(p)->elem, \
(ndr_pull_flags_fn_t)ndr_pull_GUID); \
if (!NT_STATUS_IS_OK(_nt_status)) { \
@@ -545,9 +545,9 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
#define GET_BLOB_DS(s, r, attr, mem_ctx, p, elem) do { \
struct drsuapi_DsReplicaAttribute *_a; \
_a = dsdb_find_object_attr_name(s, r, attr, NULL); \
- if (_a && _a->value_ctr.data_blob.num_values >= 1 \
- && _a->value_ctr.data_blob.values[0].data) { \
- (p)->elem = *_a->value_ctr.data_blob.values[0].data;\
+ if (_a && _a->value_ctr.num_values >= 1 \
+ && _a->value_ctr.values[0].blob) { \
+ (p)->elem = *_a->value_ctr.values[0].blob;\
talloc_steal(mem_ctx, (p)->elem.data); \
} else { \
ZERO_STRUCT((p)->elem);\
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 37f85ba527..444d0a3b8d 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -39,14 +39,14 @@ static WERROR dsdb_syntax_FOOBAR_drsuapi_to_ldb(const struct dsdb_schema *schema
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
for (i=0; i < out->num_values; i++) {
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
@@ -81,7 +81,7 @@ static WERROR dsdb_syntax_BOOL_drsuapi_to_ldb(const struct dsdb_schema *schema,
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -89,15 +89,15 @@ static WERROR dsdb_syntax_BOOL_drsuapi_to_ldb(const struct dsdb_schema *schema,
uint32_t v;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 4) {
+ if (in->value_ctr.values[i].blob->length != 4) {
return WERR_FOOBAR;
}
- v = IVAL(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = IVAL(in->value_ctr.values[i].blob->data, 0);
if (v != 0) {
str = talloc_strdup(out->values, "TRUE");
@@ -126,18 +126,18 @@ static WERROR dsdb_syntax_BOOL_ldb_to_drsuapi(const struct dsdb_schema *schema,
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
for (i=0; i < in->num_values; i++) {
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
blobs[i] = data_blob_talloc(blobs, NULL, 4);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
@@ -166,7 +166,7 @@ static WERROR dsdb_syntax_INT32_drsuapi_to_ldb(const struct dsdb_schema *schema,
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -174,15 +174,15 @@ static WERROR dsdb_syntax_INT32_drsuapi_to_ldb(const struct dsdb_schema *schema,
int32_t v;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 4) {
+ if (in->value_ctr.values[i].blob->length != 4) {
return WERR_FOOBAR;
}
- v = IVALS(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = IVALS(in->value_ctr.values[i].blob->data, 0);
str = talloc_asprintf(out->values, "%d", v);
W_ERROR_HAVE_NO_MEMORY(str);
@@ -206,12 +206,12 @@ static WERROR dsdb_syntax_INT32_ldb_to_drsuapi(const struct dsdb_schema *schema,
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -219,7 +219,7 @@ static WERROR dsdb_syntax_INT32_ldb_to_drsuapi(const struct dsdb_schema *schema,
for (i=0; i < in->num_values; i++) {
int32_t v;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
blobs[i] = data_blob_talloc(blobs, NULL, 4);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
@@ -244,7 +244,7 @@ static WERROR dsdb_syntax_INT64_drsuapi_to_ldb(const struct dsdb_schema *schema,
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -252,15 +252,15 @@ static WERROR dsdb_syntax_INT64_drsuapi_to_ldb(const struct dsdb_schema *schema,
int64_t v;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 8) {
+ if (in->value_ctr.values[i].blob->length != 8) {
return WERR_FOOBAR;
}
- v = BVALS(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = BVALS(in->value_ctr.values[i].blob->data, 0);
str = talloc_asprintf(out->values, "%lld", v);
W_ERROR_HAVE_NO_MEMORY(str);
@@ -284,12 +284,12 @@ static WERROR dsdb_syntax_INT64_ldb_to_drsuapi(const struct dsdb_schema *schema,
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -297,7 +297,7 @@ static WERROR dsdb_syntax_INT64_ldb_to_drsuapi(const struct dsdb_schema *schema,
for (i=0; i < in->num_values; i++) {
int64_t v;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
blobs[i] = data_blob_talloc(blobs, NULL, 8);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
@@ -322,7 +322,7 @@ static WERROR dsdb_syntax_NTTIME_UTC_drsuapi_to_ldb(const struct dsdb_schema *sc
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -331,15 +331,15 @@ static WERROR dsdb_syntax_NTTIME_UTC_drsuapi_to_ldb(const struct dsdb_schema *sc
time_t t;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 8) {
+ if (in->value_ctr.values[i].blob->length != 8) {
return WERR_FOOBAR;
}
- v = BVAL(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = BVAL(in->value_ctr.values[i].blob->data, 0);
v *= 10000000;
t = nt_time_to_unix(v);
@@ -373,12 +373,12 @@ static WERROR dsdb_syntax_NTTIME_UTC_ldb_to_drsuapi(const struct dsdb_schema *sc
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -387,7 +387,7 @@ static WERROR dsdb_syntax_NTTIME_UTC_ldb_to_drsuapi(const struct dsdb_schema *sc
NTTIME v;
time_t t;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
blobs[i] = data_blob_talloc(blobs, NULL, 8);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
@@ -414,7 +414,7 @@ static WERROR dsdb_syntax_NTTIME_drsuapi_to_ldb(const struct dsdb_schema *schema
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -423,15 +423,15 @@ static WERROR dsdb_syntax_NTTIME_drsuapi_to_ldb(const struct dsdb_schema *schema
time_t t;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 8) {
+ if (in->value_ctr.values[i].blob->length != 8) {
return WERR_FOOBAR;
}
- v = BVAL(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = BVAL(in->value_ctr.values[i].blob->data, 0);
v *= 10000000;
t = nt_time_to_unix(v);
@@ -457,12 +457,12 @@ static WERROR dsdb_syntax_NTTIME_ldb_to_drsuapi(const struct dsdb_schema *schema
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -471,7 +471,7 @@ static WERROR dsdb_syntax_NTTIME_ldb_to_drsuapi(const struct dsdb_schema *schema
NTTIME v;
time_t t;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
blobs[i] = data_blob_talloc(blobs, NULL, 8);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
@@ -498,21 +498,21 @@ static WERROR dsdb_syntax_DATA_BLOB_drsuapi_to_ldb(const struct dsdb_schema *sch
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
for (i=0; i < out->num_values; i++) {
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length == 0) {
+ if (in->value_ctr.values[i].blob->length == 0) {
return WERR_FOOBAR;
}
out->values[i] = data_blob_dup_talloc(out->values,
- in->value_ctr.data_blob.values[i].data);
+ in->value_ctr.values[i].blob);
W_ERROR_HAVE_NO_MEMORY(out->values[i].data);
}
@@ -532,18 +532,18 @@ static WERROR dsdb_syntax_DATA_BLOB_ldb_to_drsuapi(const struct dsdb_schema *sch
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
for (i=0; i < in->num_values; i++) {
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
blobs[i] = data_blob_dup_talloc(blobs, &in->values[i]);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
@@ -564,7 +564,7 @@ static WERROR _dsdb_syntax_OID_obj_drsuapi_to_ldb(const struct dsdb_schema *sche
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -573,15 +573,15 @@ static WERROR _dsdb_syntax_OID_obj_drsuapi_to_ldb(const struct dsdb_schema *sche
const struct dsdb_class *c;
const char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 4) {
+ if (in->value_ctr.values[i].blob->length != 4) {
return WERR_FOOBAR;
}
- v = IVAL(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = IVAL(in->value_ctr.values[i].blob->data, 0);
c = dsdb_class_by_governsID_id(schema, v);
if (!c) {
@@ -610,7 +610,7 @@ static WERROR _dsdb_syntax_OID_oid_drsuapi_to_ldb(const struct dsdb_schema *sche
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -619,15 +619,15 @@ static WERROR _dsdb_syntax_OID_oid_drsuapi_to_ldb(const struct dsdb_schema *sche
WERROR status;
const char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 4) {
+ if (in->value_ctr.values[i].blob->length != 4) {
return WERR_FOOBAR;
}
- v = IVAL(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = IVAL(in->value_ctr.values[i].blob->data, 0);
status = dsdb_map_int2oid(schema, v, out->values, &str);
W_ERROR_NOT_OK_RETURN(status);
@@ -659,7 +659,7 @@ static WERROR dsdb_syntax_OID_drsuapi_to_ldb(const struct dsdb_schema *schema,
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -668,15 +668,15 @@ static WERROR dsdb_syntax_OID_drsuapi_to_ldb(const struct dsdb_schema *schema,
const char *name;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length != 4) {
+ if (in->value_ctr.values[i].blob->length != 4) {
return WERR_FOOBAR;
}
- v = IVAL(in->value_ctr.data_blob.values[i].data->data, 0);
+ v = IVAL(in->value_ctr.values[i].blob->data, 0);
name = dsdb_lDAPDisplayName_by_id(schema, v);
if (!name) {
@@ -713,12 +713,12 @@ static WERROR dsdb_syntax_OID_ldb_to_drsuapi(const struct dsdb_schema *schema,
return dsdb_syntax_FOOBAR_ldb_to_drsuapi(schema, attr, in, mem_ctx, out);
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -726,7 +726,7 @@ static WERROR dsdb_syntax_OID_ldb_to_drsuapi(const struct dsdb_schema *schema,
for (i=0; i < in->num_values; i++) {
uint32_t v;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
blobs[i] = data_blob_talloc(blobs, NULL, 4);
W_ERROR_HAVE_NO_MEMORY(blobs[i].data);
@@ -751,7 +751,7 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(const struct dsdb_schema *schem
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -759,17 +759,17 @@ static WERROR dsdb_syntax_UNICODE_drsuapi_to_ldb(const struct dsdb_schema *schem
ssize_t ret;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length == 0) {
+ if (in->value_ctr.values[i].blob->length == 0) {
return WERR_FOOBAR;
}
ret = convert_string_talloc(out->values, CH_UTF16, CH_UNIX,
- in->value_ctr.data_blob.values[i].data->data,
- in->value_ctr.data_blob.values[i].data->length,
+ in->value_ctr.values[i].blob->data,
+ in->value_ctr.values[i].blob->length,
(void **)&str);
if (ret == -1) {
return WERR_FOOBAR;
@@ -794,12 +794,12 @@ static WERROR dsdb_syntax_UNICODE_ldb_to_drsuapi(const struct dsdb_schema *schem
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -807,7 +807,7 @@ static WERROR dsdb_syntax_UNICODE_ldb_to_drsuapi(const struct dsdb_schema *schem
for (i=0; i < in->num_values; i++) {
ssize_t ret;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
ret = convert_string_talloc(blobs, CH_UNIX, CH_UTF16,
in->values[i].data,
@@ -834,7 +834,7 @@ static WERROR dsdb_syntax_DN_drsuapi_to_ldb(const struct dsdb_schema *schema,
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -842,15 +842,15 @@ static WERROR dsdb_syntax_DN_drsuapi_to_ldb(const struct dsdb_schema *schema,
struct drsuapi_DsReplicaObjectIdentifier3 id3;
NTSTATUS status;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length == 0) {
+ if (in->value_ctr.values[i].blob->length == 0) {
return WERR_FOOBAR;
}
- status = ndr_pull_struct_blob_all(in->value_ctr.data_blob.values[i].data,
+ status = ndr_pull_struct_blob_all(in->value_ctr.values[i].blob,
out->values, &id3,
(ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3);
if (!NT_STATUS_IS_OK(status)) {
@@ -877,12 +877,12 @@ static WERROR dsdb_syntax_DN_ldb_to_drsuapi(const struct dsdb_schema *schema,
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -891,7 +891,7 @@ static WERROR dsdb_syntax_DN_ldb_to_drsuapi(const struct dsdb_schema *schema,
NTSTATUS status;
struct drsuapi_DsReplicaObjectIdentifier3 id3;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
/* TODO: handle id3.guid and id3.sid */
ZERO_STRUCT(id3);
@@ -919,7 +919,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(const struct dsdb_schema *sch
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -929,15 +929,15 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(const struct dsdb_schema *sch
char *str;
NTSTATUS status;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length == 0) {
+ if (in->value_ctr.values[i].blob->length == 0) {
return WERR_FOOBAR;
}
- status = ndr_pull_struct_blob_all(in->value_ctr.data_blob.values[i].data,
+ status = ndr_pull_struct_blob_all(in->value_ctr.values[i].blob,
out->values, &id3b,
(ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3Binary);
if (!NT_STATUS_IS_OK(status)) {
@@ -974,12 +974,12 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(const struct dsdb_schema *sch
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -988,7 +988,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(const struct dsdb_schema *sch
NTSTATUS status;
struct drsuapi_DsReplicaObjectIdentifier3Binary id3b;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
/* TODO: handle id3b.guid and id3b.sid, id3.binary */
ZERO_STRUCT(id3b);
@@ -1017,7 +1017,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(const struct dsdb_
out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName);
W_ERROR_HAVE_NO_MEMORY(out->name);
- out->num_values = in->value_ctr.data_blob.num_values;
+ out->num_values = in->value_ctr.num_values;
out->values = talloc_array(mem_ctx, struct ldb_val, out->num_values);
W_ERROR_HAVE_NO_MEMORY(out->values);
@@ -1026,23 +1026,23 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_drsuapi_to_ldb(const struct dsdb_
ssize_t ret;
char *str;
- if (in->value_ctr.data_blob.values[i].data == NULL) {
+ if (in->value_ctr.values[i].blob == NULL) {
return WERR_FOOBAR;
}
- if (in->value_ctr.data_blob.values[i].data->length < 4) {
+ if (in->value_ctr.values[i].blob->length < 4) {
return WERR_FOOBAR;
}
- len = IVAL(in->value_ctr.data_blob.values[i].data->data, 0);
+ len = IVAL(in->value_ctr.values[i].blob->data, 0);
- if (len != in->value_ctr.data_blob.values[i].data->length) {
+ if (len != in->value_ctr.values[i].blob->length) {
return WERR_FOOBAR;
}
ret = convert_string_talloc(out->values, CH_UTF16, CH_UNIX,
- in->value_ctr.data_blob.values[i].data->data+4,
- in->value_ctr.data_blob.values[i].data->length-4,
+ in->value_ctr.values[i].blob->data+4,
+ in->value_ctr.values[i].blob->length-4,
(void **)&str);
if (ret == -1) {
return WERR_FOOBAR;
@@ -1067,12 +1067,12 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_ldb_to_drsuapi(const struct dsdb_
return WERR_FOOBAR;
}
- out->attid = attr->attributeID_id;
- out->value_ctr.data_blob.num_values = in->num_values;
- out->value_ctr.data_blob.values = talloc_array(mem_ctx,
- struct drsuapi_DsAttributeValueDataBlob,
- in->num_values);
- W_ERROR_HAVE_NO_MEMORY(out->value_ctr.data_blob.values);
+ out->attid = attr->attributeID_id;
+ out->value_ctr.num_values = in->num_values;
+ out->value_ctr.values = talloc_array(mem_ctx,
+ struct drsuapi_DsAttributeValue,
+ in->num_values);
+ W_ERROR_HAVE_NO_MEMORY(out->value_ctr.values);
blobs = talloc_array(mem_ctx, DATA_BLOB, in->num_values);
W_ERROR_HAVE_NO_MEMORY(blobs);
@@ -1081,7 +1081,7 @@ static WERROR dsdb_syntax_PRESENTATION_ADDRESS_ldb_to_drsuapi(const struct dsdb_
uint8_t *data;
ssize_t ret;
- out->value_ctr.data_blob.values[i].data = &blobs[i];
+ out->value_ctr.values[i].blob = &blobs[i];
ret = convert_string_talloc(blobs, CH_UNIX, CH_UTF16,
in->values[i].data,
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index f6eeb470f3..c5e959f309 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -1053,13 +1053,13 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
/* ntSecurityDescriptor */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
struct security_descriptor *v;
struct dom_sid *domain_admins_sid;
const char *domain_admins_sid_str;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1118,21 +1118,21 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
c->status = ndr_push_struct_blob(&vd[0], vd, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_ntSecurityDescriptor;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_ntSecurityDescriptor;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* objectClass: nTDSDSA */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1144,22 +1144,22 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
/* value for nTDSDSA */
SIVAL(vd[0].data, 0, 0x0017002F);
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_objectClass;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_objectClass;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* objectCategory: CN=NTDS-DSA,CN=Schema,... */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
struct drsuapi_DsReplicaObjectIdentifier3 v[1];
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1175,22 +1175,22 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
(ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_objectCategory;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_objectCategory;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* invocationId: random guid */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
const struct GUID *v;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1201,22 +1201,22 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
c->status = ndr_push_struct_blob(&vd[0], vd, v, (ndr_push_flags_fn_t)ndr_push_GUID);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_invocationId;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_invocationId;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* hasMasterNCs: ... */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
struct drsuapi_DsReplicaObjectIdentifier3 v[3];
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 3);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 3);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 3);
@@ -1246,24 +1246,24 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
(ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
- vs[1].data = &vd[1];
- vs[2].data = &vd[2];
+ vs[0].blob = &vd[0];
+ vs[1].blob = &vd[1];
+ vs[2].blob = &vd[2];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_hasMasterNCs;
- attrs[i].value_ctr.data_blob.num_values = 3;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_hasMasterNCs;
+ attrs[i].value_ctr.num_values = 3;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* msDS-hasMasterNCs: ... */
if (w2k3) {
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
struct drsuapi_DsReplicaObjectIdentifier3 v[3];
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 3);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 3);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 3);
@@ -1293,24 +1293,24 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
(ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
- vs[1].data = &vd[1];
- vs[2].data = &vd[2];
+ vs[0].blob = &vd[0];
+ vs[1].blob = &vd[1];
+ vs[2].blob = &vd[2];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs;
- attrs[i].value_ctr.data_blob.num_values = 3;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs;
+ attrs[i].value_ctr.num_values = 3;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* dMDLocation: CN=Schema,... */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
struct drsuapi_DsReplicaObjectIdentifier3 v[1];
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1324,22 +1324,22 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
(ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_dMDLocation;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_dMDLocation;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* msDS-HasDomainNCs: <domain_partition> */
if (w2k3) {
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
struct drsuapi_DsReplicaObjectIdentifier3 v[1];
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1353,21 +1353,21 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
(ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* msDS-Behavior-Version */
if (w2k3) {
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1378,21 +1378,21 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
SIVAL(vd[0].data, 0, DS_BEHAVIOR_WIN2003);
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_msDS_Behavior_Version;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_msDS_Behavior_Version;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* systemFlags */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1403,22 +1403,22 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
SIVAL(vd[0].data, 0, SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE);
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_systemFlags;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_systemFlags;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
/* serverReference: ... */
{
- struct drsuapi_DsAttributeValueDataBlob *vs;
+ struct drsuapi_DsAttributeValue *vs;
DATA_BLOB *vd;
struct drsuapi_DsReplicaObjectIdentifier3 v[1];
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValue, 1);
if (composite_nomem(vs, c)) return;
vd = talloc_array(vs, DATA_BLOB, 1);
@@ -1432,11 +1432,11 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
(ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3);
if (!composite_is_ok(c)) return;
- vs[0].data = &vd[0];
+ vs[0].blob = &vd[0];
- attrs[i].attid = DRSUAPI_ATTRIBUTE_serverReference;
- attrs[i].value_ctr.data_blob.num_values = 1;
- attrs[i].value_ctr.data_blob.values = vs;
+ attrs[i].attid = DRSUAPI_ATTRIBUTE_serverReference;
+ attrs[i].value_ctr.num_values = 1;
+ attrs[i].value_ctr.values = vs;
i++;
}
diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl
index 46fa90509b..104f00febd 100644
--- a/source4/librpc/idl/drsuapi.idl
+++ b/source4/librpc/idl/drsuapi.idl
@@ -436,47 +436,14 @@ interface drsuapi
/* Generic DATA_BLOB values */
typedef struct {
- [range(0,10485760),value(ndr_size_DATA_BLOB(0,r->data,0))] uint32 length;
- DATA_BLOB *data;
- } drsuapi_DsAttributeValueDataBlob;
+ [range(0,10485760),value(ndr_size_DATA_BLOB(0,r->blob,0))] uint32 __ndr_size;
+ DATA_BLOB *blob;
+ } drsuapi_DsAttributeValue;
typedef struct {
[range(0,10485760)] uint32 num_values;
- [size_is(num_values)] drsuapi_DsAttributeValueDataBlob *values;
- } drsuapi_DsAttributeValueCtrDataBlob;
-
- /* objectClass values */
- typedef struct {
- [range(0,10485760),value(4)] uint32 __ndr_size;
- [subcontext(4)] drsuapi_DsObjectClassId *objectClassId;
- } drsuapi_DsAttributeValueObjectClassId;
-
- typedef struct {
- [range(0,10485760)] uint32 num_values;
- [size_is(num_values)] drsuapi_DsAttributeValueObjectClassId *values;
- } drsuapi_DsAttributeValueCtrObjectClassId;
-
- /* uint32 values */
- typedef struct {
- [range(0,10485760),value(4)] uint32 __ndr_size;
- [subcontext(4)] uint32 *value;
- } drsuapi_DsAttributeValueUINT32;
-
- typedef struct {
- [range(0,10485760)] uint32 num_values;
- [size_is(num_values)] drsuapi_DsAttributeValueUINT32 *values;
- } drsuapi_DsAttributeValueCtrUINT32;
-
- /* UnicodeString values */
- typedef struct {
- [range(0,10485760)] uint32 length;
- [subcontext(4)] nstring *string;
- } drsuapi_DsAttributeValueUnicodeString;
-
- typedef struct {
- [range(0,10485760)] uint32 num_values;
- [size_is(num_values)] drsuapi_DsAttributeValueUnicodeString *values;
- } drsuapi_DsAttributeValueCtrUnicodeString;
+ [size_is(num_values)] drsuapi_DsAttributeValue *values;
+ } drsuapi_DsAttributeValueCtr;
/* DN String values */
typedef [public,gensize] struct {
@@ -497,35 +464,9 @@ interface drsuapi
[flag(NDR_REMAINING)] DATA_BLOB binary;
} drsuapi_DsReplicaObjectIdentifier3Binary;
- typedef struct {
- [range(0,10485760),value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(object, ndr->flags))] uint32 __ndr_size;
- [subcontext(4),subcontext_size(__ndr_size)] drsuapi_DsReplicaObjectIdentifier3 *object;
- } drsuapi_DsAttributeValueDNString;
-
- typedef struct {
- [range(0,10485760)] uint32 num_values;
- [size_is(num_values)] drsuapi_DsAttributeValueDNString *values;
- } drsuapi_DsAttributeValueCtrDNString;
-
- /* GUID values */
- typedef struct {
- [range(0,10485760),value(ndr_size_GUID(guid, ndr->flags))] uint32 __ndr_size;
- [subcontext(4)] GUID *guid;
- } drsuapi_DsAttributeValueGUID;
-
- typedef struct {
- [range(0,10485760)] uint32 num_values;
- [size_is(num_values)] drsuapi_DsAttributeValueGUID *values;
- } drsuapi_DsAttributeValueCtrGUID;
-
- typedef [nodiscriminant] union {
- /* the default is the DATA_BLOB */
- [default] drsuapi_DsAttributeValueCtrDataBlob data_blob;
- } drsuapi_DsReplicaAttributeValueCtr;
-
typedef [public] struct {
drsuapi_DsAttributeId attid;
- [switch_is(attid)] drsuapi_DsReplicaAttributeValueCtr value_ctr;
+ drsuapi_DsAttributeValueCtr value_ctr;
} drsuapi_DsReplicaAttribute;
typedef struct {
@@ -576,13 +517,9 @@ interface drsuapi
} drsuapi_DsGetNCChangesCtr1;
typedef struct {
- drsuapi_DsReplicaObjectIdentifier *dn;
- drsuapi_DsAttributeId attid;
- /* this dn_string, depends on the attid, maybe could be another
- * attribute syntax
- */
- drsuapi_DsAttributeValueDNString dn_string;
- uint32 u1;
+ drsuapi_DsReplicaObjectIdentifier *identifier;
+ drsuapi_DsReplicaAttribute attribute;
+ uint32 unknown1;
NTTIME_1sec time1;
drsuapi_DsReplicaMetaData meta_data;
} drsuapi_DsReplicaLinkedAttribute;
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index ecee329ea3..ece76d4678 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -157,12 +157,12 @@ static NTSTATUS test_apply_schema(struct test_become_dc_state *s,
switch (a->attid) {
case DRSUAPI_ATTRIBUTE_objectClass:
- for (j=0; j < a->value_ctr.data_blob.num_values; j++) {
+ for (j=0; j < a->value_ctr.num_values; j++) {
uint32_t val = 0xFFFFFFFF;
- if (a->value_ctr.data_blob.values[i].data
- && a->value_ctr.data_blob.values[i].data->length == 4) {
- val = IVAL(a->value_ctr.data_blob.values[i].data->data,0);
+ if (a->value_ctr.values[i].blob
+ && a->value_ctr.values[i].blob->length == 4) {
+ val = IVAL(a->value_ctr.values[i].blob->data,0);
}
if (val == DRSUAPI_OBJECTCLASS_attributeSchema) {
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index 63d642b64a..972c2f1ecf 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -354,11 +354,11 @@ static void test_analyse_objects(struct DsSyncTest *ctx,
continue;
}
- if (attr->value_ctr.data_blob.num_values != 1) continue;
+ if (attr->value_ctr.num_values != 1) continue;
- if (!attr->value_ctr.data_blob.values[0].data) continue;
+ if (!attr->value_ctr.values[0].blob) continue;
- data = attr->value_ctr.data_blob.values[0].data;
+ data = attr->value_ctr.values[0].blob;
if (!dn_printed) {
DEBUG(0,("DN: %s\n", dn));