summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema_init.c31
-rw-r--r--source4/dsdb/schema/schema_syntax.c14
2 files changed, 29 insertions, 16 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 6de87708c7..c85988d938 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -451,8 +451,35 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
} while (0)
#define GET_DN_DS(s, r, attr, mem_ctx, p, elem, strict) do { \
- /* TODO: ! */ \
- (p)->elem = NULL; \
+ struct drsuapi_DsReplicaAttribute *_a; \
+ _a = dsdb_find_object_attr_name(s, r, attr, NULL); \
+ if (strict && !_a) { \
+ d_printf("%s: %s == NULL\n", __location__, attr); \
+ return WERR_INVALID_PARAM; \
+ } \
+ if (strict && _a->value_ctr.data_blob.num_values != 1) { \
+ d_printf("%s: %s num_values == %u\n", __location__, attr, \
+ _a->value_ctr.data_blob.num_values); \
+ return WERR_INVALID_PARAM; \
+ } \
+ if (strict && !_a->value_ctr.data_blob.values[0].data) { \
+ 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) { \
+ struct drsuapi_DsReplicaObjectIdentifier3 _id3; \
+ NTSTATUS _nt_status; \
+ _nt_status = ndr_pull_struct_blob_all(_a->value_ctr.data_blob.values[0].data, \
+ mem_ctx, &_id3,\
+ (ndr_pull_flags_fn_t)ndr_pull_drsuapi_DsReplicaObjectIdentifier3);\
+ if (!NT_STATUS_IS_OK(_nt_status)) { \
+ return ntstatus_to_werror(_nt_status); \
+ } \
+ (p)->elem = _id3.dn; \
+ } else { \
+ (p)->elem = NULL; \
+ } \
} while (0)
#define GET_BOOL_DS(s, r, attr, p, elem, strict) do { \
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 5a96f11d6b..37f85ba527 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -830,20 +830,6 @@ static WERROR dsdb_syntax_DN_drsuapi_to_ldb(const struct dsdb_schema *schema,
{
uint32_t i;
-switch (attr->attributeID_id) {
-case DRSUAPI_ATTRIBUTE_member:
-case DRSUAPI_ATTRIBUTE_objectCategory:
-case DRSUAPI_ATTRIBUTE_hasMasterNCs:
-case DRSUAPI_ATTRIBUTE_dMDLocation:
-case DRSUAPI_ATTRIBUTE_fSMORoleOwner:
-case DRSUAPI_ATTRIBUTE_wellKnownObjects:
-case DRSUAPI_ATTRIBUTE_serverReference:
-case DRSUAPI_ATTRIBUTE_serverReferenceBL:
-case DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs:
-case DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs:
- 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);