1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r20475: remove special case for GUID values

metze
(This used to be commit b7ab1c0039)
This commit is contained in:
Stefan Metzmacher 2007-01-02 13:54:37 +00:00 committed by Gerald (Jerry) Carter
parent 04b9446b2a
commit 2754a73d22
4 changed files with 31 additions and 28 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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++;
}

View File

@ -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;