summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-02 13:54:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:35:56 -0500
commit2754a73d221d13095a4228fede25ffc64134beb5 (patch)
treeda3b280036d7f566fd6aea3fe5714d50da484f93 /source4/dsdb/schema
parent04b9446b2a06362a85fde456fbb2fdc0ef3fd69e (diff)
downloadsamba-2754a73d221d13095a4228fede25ffc64134beb5.tar.gz
samba-2754a73d221d13095a4228fede25ffc64134beb5.tar.bz2
samba-2754a73d221d13095a4228fede25ffc64134beb5.zip
r20475: remove special case for GUID values
metze (This used to be commit b7ab1c0039cd8000861cd89ca072d9d2b0bbf9de)
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema_init.c24
-rw-r--r--source4/dsdb/schema/schema_syntax.c6
2 files changed, 16 insertions, 14 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);