summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-10 01:27:12 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-10 01:27:12 +1000
commitb65d6cf0135785aa10857c107c3a094ce170bbf7 (patch)
treeb29888593705f619140b40e2cf4afce941fdf00a /source4
parent557cc460f24e00dc6ede087772a5800e39e4ea63 (diff)
downloadsamba-b65d6cf0135785aa10857c107c3a094ce170bbf7.tar.gz
samba-b65d6cf0135785aa10857c107c3a094ce170bbf7.tar.bz2
samba-b65d6cf0135785aa10857c107c3a094ce170bbf7.zip
s4/drs: when we don't find an attribute use zero values
thanks to metze for pointing this out
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/drsuapi/getncchanges.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c
index 1455b6b003..6e65e3185b 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -112,25 +112,16 @@ static WERROR get_nc_changes_build_object(struct drsuapi_DsReplicaObjectListItem
if (el == NULL) {
DEBUG(0,("No element '%s' for attributeID %u in message\n",
sa->lDAPDisplayName, md.ctr.ctr1.array[i].attid));
- /* we really should find it, but let's try to
- * cope for now by going to the next one
- */
- memmove(&obj->meta_data_ctr->meta_data[i], &obj->meta_data_ctr->meta_data[i+1],
- sizeof(obj->meta_data_ctr->meta_data[i])*(obj->object.attribute_ctr.num_attributes-(i+1)));
- memmove(&md.ctr.ctr1.array[i], &md.ctr.ctr1.array[i+1],
- sizeof(md.ctr.ctr1.array[i])*(obj->object.attribute_ctr.num_attributes-(i+1)));
- obj->object.attribute_ctr.num_attributes--;
- i--;
- obj->meta_data_ctr->count--;
- continue;
- }
-
- werr = dsdb_attribute_ldb_to_drsuapi(sam_ctx, schema, el, obj,
- &obj->object.attribute_ctr.attributes[i]);
- if (!W_ERROR_IS_OK(werr)) {
- DEBUG(0,("Unable to convert %s to DRS object - %s\n",
- sa->lDAPDisplayName, win_errstr(werr)));
- return werr;
+ ZERO_STRUCT(obj->object.attribute_ctr.attributes[i]);
+ obj->object.attribute_ctr.attributes[i].attid = md.ctr.ctr1.array[i].attid;
+ } else {
+ werr = dsdb_attribute_ldb_to_drsuapi(sam_ctx, schema, el, obj,
+ &obj->object.attribute_ctr.attributes[i]);
+ if (!W_ERROR_IS_OK(werr)) {
+ DEBUG(0,("Unable to convert %s to DRS object - %s\n",
+ sa->lDAPDisplayName, win_errstr(werr)));
+ return werr;
+ }
}
}