summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-02 14:14:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:35:57 -0500
commitd70852659b4dbef9979be81f5d42e5587fc94c75 (patch)
treea82fe150a154c5aa09ade33a9ba2e0a02954dfaf /source4/libnet
parent2754a73d221d13095a4228fede25ffc64134beb5 (diff)
downloadsamba-d70852659b4dbef9979be81f5d42e5587fc94c75.tar.gz
samba-d70852659b4dbef9979be81f5d42e5587fc94c75.tar.bz2
samba-d70852659b4dbef9979be81f5d42e5587fc94c75.zip
r20476: get rid of extra case for uint32 values
metze (This used to be commit 13ccd405b5dbb595e5ab67879260462e5a767a8b)
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_become_dc.c63
1 files changed, 36 insertions, 27 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 30fc1774d5..954b886b12 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -1128,23 +1128,26 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
/* objectClass: nTDSDSA */
{
- struct drsuapi_DsAttributeValueObjectClassId *vs;
- enum drsuapi_DsObjectClassId *v;
+ struct drsuapi_DsAttributeValueDataBlob *vs;
+ DATA_BLOB *vd;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueObjectClassId, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
if (composite_nomem(vs, c)) return;
- v = talloc_array(vs, enum drsuapi_DsObjectClassId, 1);
- if (composite_nomem(v, c)) return;
+ vd = talloc_array(vs, DATA_BLOB, 1);
+ if (composite_nomem(vd, c)) return;
+
+ vd[0] = data_blob_talloc(vd, NULL, 4);
+ if (composite_nomem(vd[0].data, c)) return;
/* value for nTDSDSA */
- v[0] = 0x0017002F;
+ SIVAL(vd[0].data, 0, 0x0017002F);
- vs[0].objectClassId = &v[0];
+ vs[0].data = &vd[0];
attrs[i].attid = DRSUAPI_ATTRIBUTE_objectClass;
- attrs[i].value_ctr.object_class_id.num_values = 1;
- attrs[i].value_ctr.object_class_id.values = vs;
+ attrs[i].value_ctr.data_blob.num_values = 1;
+ attrs[i].value_ctr.data_blob.values = vs;
i++;
}
@@ -1319,44 +1322,50 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s)
/* msDS-Behavior-Version */
if (w2k3) {
- struct drsuapi_DsAttributeValueUINT32 *vs;
- uint32_t *v;
+ struct drsuapi_DsAttributeValueDataBlob *vs;
+ DATA_BLOB *vd;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueUINT32, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
if (composite_nomem(vs, c)) return;
- v = talloc_array(vs, uint32_t, 1);
- if (composite_nomem(v, c)) return;
+ vd = talloc_array(vs, DATA_BLOB, 1);
+ if (composite_nomem(vd, c)) return;
+
+ vd[0] = data_blob_talloc(vd, NULL, 4);
+ if (composite_nomem(vd[0].data, c)) return;
- v[0] = DS_BEHAVIOR_WIN2003;
+ SIVAL(vd[0].data, 0, DS_BEHAVIOR_WIN2003);
- vs[0].value = &v[0];
+ vs[0].data = &vd[0];
attrs[i].attid = DRSUAPI_ATTRIBUTE_msDS_Behavior_Version;
- attrs[i].value_ctr.uint32.num_values = 1;
- attrs[i].value_ctr.uint32.values = vs;
+ attrs[i].value_ctr.data_blob.num_values = 1;
+ attrs[i].value_ctr.data_blob.values = vs;
i++;
}
/* systemFlags */
{
- struct drsuapi_DsAttributeValueUINT32 *vs;
- uint32_t *v;
+ struct drsuapi_DsAttributeValueDataBlob *vs;
+ DATA_BLOB *vd;
- vs = talloc_array(attrs, struct drsuapi_DsAttributeValueUINT32, 1);
+ vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1);
if (composite_nomem(vs, c)) return;
- v = talloc_array(vs, uint32_t, 1);
- if (composite_nomem(v, c)) return;
+ vd = talloc_array(vs, DATA_BLOB, 1);
+ if (composite_nomem(vd, c)) return;
- v[0] = SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE;
+ vd[0] = data_blob_talloc(vd, NULL, 4);
+ if (composite_nomem(vd[0].data, c)) return;
- vs[0].value = &v[0];
+ SIVAL(vd[0].data, 0, SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE);
+
+ vs[0].data = &vd[0];
attrs[i].attid = DRSUAPI_ATTRIBUTE_systemFlags;
- attrs[i].value_ctr.uint32.num_values = 1;
- attrs[i].value_ctr.uint32.values = vs;
+ attrs[i].value_ctr.data_blob.num_values = 1;
+ attrs[i].value_ctr.data_blob.values = vs;
i++;
}