summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-28 17:19:29 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-02 08:16:54 +1100
commit38160deac4d6f4a8ae22fcedcf55114bc0372f31 (patch)
treef89da2284e933256b2fda390e8a9090c6b26f128 /source4/dsdb/samdb
parent5e52c7149fb6f4e79541cde719f7f014d8954922 (diff)
downloadsamba-38160deac4d6f4a8ae22fcedcf55114bc0372f31.tar.gz
samba-38160deac4d6f4a8ae22fcedcf55114bc0372f31.tar.bz2
samba-38160deac4d6f4a8ae22fcedcf55114bc0372f31.zip
s4-drs: use dsdb linked attribute parse functions
This makes the code considerably more readable
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 3c713ec4d9..baae44a30d 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -3345,9 +3345,7 @@ static int replmd_process_linked_attribute(struct ldb_module *module,
const struct dsdb_attribute *attr;
struct dsdb_dn *dsdb_dn;
uint64_t seq_num = 0;
- struct drsuapi_DsReplicaAttribute drs;
- struct drsuapi_DsAttributeValue val;
- struct ldb_message_element new_el, *old_el;
+ struct ldb_message_element *old_el;
WERROR status;
time_t t = time(NULL);
struct ldb_result *res;
@@ -3358,10 +3356,6 @@ static int replmd_process_linked_attribute(struct ldb_module *module,
bool active = (la->flags & DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE)?true:false;
const struct GUID *our_invocation_id;
- drs.value_ctr.num_values = 1;
- drs.value_ctr.values = &val;
- val.blob = la->value.blob;
-
/*
linked_attributes[0]:
&objs->linked_attributes[i]: struct drsuapi_DsReplicaLinkedAttribute
@@ -3462,23 +3456,10 @@ linked_attributes[0]:
return ret;
}
- status = attr->syntax->drsuapi_to_ldb(ldb, schema, attr, &drs, tmp_ctx, &new_el);
+ status = dsdb_dn_la_from_blob(ldb, attr, schema, tmp_ctx, la->value.blob, &dsdb_dn);
if (!W_ERROR_IS_OK(status)) {
- ldb_asprintf_errstring(ldb, "Failed to parsed linked attribute blob for %s on %s\n",
- old_el->name, ldb_dn_get_linearized(msg->dn));
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- if (new_el.num_values != 1) {
- ldb_asprintf_errstring(ldb, "Failed to find value in linked attribute blob for %s on %s\n",
- old_el->name, ldb_dn_get_linearized(msg->dn));
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- dsdb_dn = dsdb_dn_parse(tmp_ctx, ldb, &new_el.values[0], attr->syntax->ldap_oid);
- if (!dsdb_dn) {
- ldb_asprintf_errstring(ldb, "Failed to parse DN in linked attribute blob for %s on %s\n",
- old_el->name, ldb_dn_get_linearized(msg->dn));
+ ldb_asprintf_errstring(ldb, "Failed to parsed linked attribute blob for %s on %s - %s\n",
+ old_el->name, ldb_dn_get_linearized(msg->dn), win_errstr(status));
return LDB_ERR_OPERATIONS_ERROR;
}