diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-01-02 13:54:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:35:56 -0500 |
commit | 2754a73d221d13095a4228fede25ffc64134beb5 (patch) | |
tree | da3b280036d7f566fd6aea3fe5714d50da484f93 | |
parent | 04b9446b2a06362a85fde456fbb2fdc0ef3fd69e (diff) | |
download | samba-2754a73d221d13095a4228fede25ffc64134beb5.tar.gz samba-2754a73d221d13095a4228fede25ffc64134beb5.tar.bz2 samba-2754a73d221d13095a4228fede25ffc64134beb5.zip |
r20475: remove special case for GUID values
metze
(This used to be commit b7ab1c0039cd8000861cd89ca072d9d2b0bbf9de)
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 24 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_syntax.c | 6 | ||||
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 25 | ||||
-rw-r--r-- | source4/librpc/idl/drsuapi.idl | 4 |
4 files changed, 31 insertions, 28 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 4c781946e2..23b5fd9dcc 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -23,7 +23,8 @@ #include "includes.h" #include "dsdb/samdb/samdb.h" #include "lib/util/dlinklist.h" -#include "librpc/gen_ndr/drsuapi.h" +#include "librpc/gen_ndr/ndr_misc.h" +#include "librpc/gen_ndr/ndr_drsuapi.h" WERROR dsdb_load_oid_mappings(struct dsdb_schema *schema, const struct drsuapi_DsReplicaOIDMapping_Ctr *ctr) { @@ -479,12 +480,19 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb } \ } while (0) -#define GET_GUID_DS(s, r, attr, p, elem) do { \ +#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.guid.num_values >= 1 \ - && _a->value_ctr.guid.values[0].guid) { \ - (p)->elem = *_a->value_ctr.guid.values[0].guid;\ + 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) { \ + NTSTATUS _nt_status; \ + _nt_status = ndr_pull_struct_blob_all(_a->value_ctr.data_blob.values[0].data, \ + mem_ctx, &(p)->elem, \ + (ndr_pull_flags_fn_t)ndr_pull_GUID); \ + if (!NT_STATUS_IS_OK(_nt_status)) { \ + return ntstatus_to_werror(_nt_status); \ + } \ } else { \ ZERO_STRUCT((p)->elem);\ } \ @@ -519,10 +527,10 @@ WERROR dsdb_attribute_from_drsuapi(struct dsdb_schema *schema, win_errstr(status))); return status; } - GET_GUID_DS(schema, r, "schemaIDGUID", attr, schemaIDGUID); + GET_GUID_DS(schema, r, "schemaIDGUID", mem_ctx, attr, schemaIDGUID); GET_UINT32_DS(schema, r, "mAPIID", attr, mAPIID); - GET_GUID_DS(schema, r, "attributeSecurityGUID", attr, attributeSecurityGUID); + GET_GUID_DS(schema, r, "attributeSecurityGUID", mem_ctx, attr, attributeSecurityGUID); GET_UINT32_DS(schema, r, "searchFlags", attr, searchFlags); GET_UINT32_DS(schema, r, "systemFlags", attr, systemFlags); @@ -581,7 +589,7 @@ WERROR dsdb_class_from_drsuapi(struct dsdb_schema *schema, win_errstr(status))); return status; } - GET_GUID_DS(schema, r, "schemaIDGUID", obj, schemaIDGUID); + GET_GUID_DS(schema, r, "schemaIDGUID", mem_ctx, obj, schemaIDGUID); GET_UINT32_DS(schema, r, "objectClassCategory", obj, objectClassCategory); GET_STRING_DS(schema, r, "rDNAttID", mem_ctx, obj, rDNAttID, False); diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index a0c7214110..f31dfbda2b 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -506,12 +506,6 @@ static WERROR dsdb_syntax_DATA_BLOB_drsuapi_to_ldb(const struct dsdb_schema *sch { uint32_t i; -switch (attr->attributeID_id) { -case DRSUAPI_ATTRIBUTE_invocationId: -case DRSUAPI_ATTRIBUTE_schemaIDGUID: - return dsdb_syntax_FOOBAR_drsuapi_to_ldb(schema,attr, in, mem_ctx, out); -} - out->flags = 0; out->name = talloc_strdup(mem_ctx, attr->lDAPDisplayName); W_ERROR_HAVE_NO_MEMORY(out->name); diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index eb929d57e4..30fc1774d5 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -29,6 +29,7 @@ #include "dsdb/common/flags.h" #include "librpc/gen_ndr/ndr_drsuapi_c.h" #include "libcli/security/security.h" +#include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_security.h" struct libnet_BecomeDC_state { @@ -1113,7 +1114,7 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) NULL); if (composite_nomem(v, c)) return; - c->status = ndr_push_struct_blob(&vd[0], r, v,(ndr_push_flags_fn_t)ndr_push_security_descriptor); + 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]; @@ -1176,22 +1177,26 @@ static void becomeDC_drsuapi1_add_entry_send(struct libnet_BecomeDC_state *s) /* invocationId: random guid */ { - struct drsuapi_DsAttributeValueGUID *vs; - struct GUID *v; + struct drsuapi_DsAttributeValueDataBlob *vs; + DATA_BLOB *vd; + const struct GUID *v; - vs = talloc_array(attrs, struct drsuapi_DsAttributeValueGUID, 1); + vs = talloc_array(attrs, struct drsuapi_DsAttributeValueDataBlob, 1); if (composite_nomem(vs, c)) return; - v = talloc_array(vs, struct GUID, 1); - if (composite_nomem(v, c)) return; + vd = talloc_array(vs, DATA_BLOB, 1); + if (composite_nomem(vd, c)) return; - v[0] = s->dest_dsa.invocation_id; + v = &s->dest_dsa.invocation_id; - vs[0].guid = &v[0]; + 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]; attrs[i].attid = DRSUAPI_ATTRIBUTE_invocationId; - attrs[i].value_ctr.guid.num_values = 1; - attrs[i].value_ctr.guid.values = vs; + attrs[i].value_ctr.data_blob.num_values = 1; + attrs[i].value_ctr.data_blob.values = vs; i++; } diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl index c7c8bc3f7c..dbe0e92be0 100644 --- a/source4/librpc/idl/drsuapi.idl +++ b/source4/librpc/idl/drsuapi.idl @@ -534,10 +534,6 @@ interface drsuapi [case(DRSUAPI_ATTRIBUTE_systemFlags)] drsuapi_DsAttributeValueCtrUINT32 uint32; [case(DRSUAPI_ATTRIBUTE_msDS_Behavior_Version)] drsuapi_DsAttributeValueCtrUINT32 uint32; - /* GUID */ - [case(DRSUAPI_ATTRIBUTE_invocationId)] drsuapi_DsAttributeValueCtrGUID guid; - [case(DRSUAPI_ATTRIBUTE_schemaIDGUID)] drsuapi_DsAttributeValueCtrGUID guid; - /* UnicodeString */ [case(DRSUAPI_ATTRIBUTE_description)] drsuapi_DsAttributeValueCtrUnicodeString unicode_string; [case(DRSUAPI_ATTRIBUTE_adminDisplayName)] drsuapi_DsAttributeValueCtrUnicodeString unicode_string; |