diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-01-02 19:29:32 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:35:59 -0500 |
commit | 16d6d8d4c5d0d6e0b3aa6b94e20c2ed3317d1fbd (patch) | |
tree | 616b281f4ad34368e813d35847d8132909ab2722 /source4/dsdb/schema/schema_init.c | |
parent | c0d70be7d0bda6f0530b595680a68849200f0e27 (diff) | |
download | samba-16d6d8d4c5d0d6e0b3aa6b94e20c2ed3317d1fbd.tar.gz samba-16d6d8d4c5d0d6e0b3aa6b94e20c2ed3317d1fbd.tar.bz2 samba-16d6d8d4c5d0d6e0b3aa6b94e20c2ed3317d1fbd.zip |
r20484: get rid of the special case for DN strings
metze
(This used to be commit 4c2addf2dd5b74fa0026249ce373ff4becaaef40)
Diffstat (limited to 'source4/dsdb/schema/schema_init.c')
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 31 |
1 files changed, 29 insertions, 2 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 { \ |