summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-07-02 15:33:01 +1000
committerAndrew Tridgell <tridge@samba.org>2009-07-02 15:33:01 +1000
commit0aec87454b0b2e14b8fa32607d2173caa168d4de (patch)
tree8e21048319ea6f566079e8866595282752fc8ff4 /source4
parentacfb01a8f63f5b84c271ae0599bf40d92237cdf9 (diff)
downloadsamba-0aec87454b0b2e14b8fa32607d2173caa168d4de.tar.gz
samba-0aec87454b0b2e14b8fa32607d2173caa168d4de.tar.bz2
samba-0aec87454b0b2e14b8fa32607d2173caa168d4de.zip
decrypt all objects in a DRS record, not just the first one
We found this as an object came across from w2k3 with zero values, which caused a segv when we tried to decrypt the first value
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/repl/replicated_objects.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c
index 78af3c8f6d..d96a063599 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -117,14 +117,17 @@ static WERROR dsdb_convert_object(struct ldb_context *ldb,
struct drsuapi_DsReplicaMetaData *d;
struct replPropertyMetaData1 *m;
struct ldb_message_element *e;
+ int j;
a = &in->object.attribute_ctr.attributes[i];
d = &in->meta_data_ctr->meta_data[i];
m = &md->ctr.ctr1.array[i];
e = &msg->elements[i];
- status = drsuapi_decrypt_attribute(a->value_ctr.values[0].blob, gensec_skey, rid, a);
- W_ERROR_NOT_OK_RETURN(status);
+ for (j=0; j<a->value_ctr.num_values; j++) {
+ status = drsuapi_decrypt_attribute(a->value_ctr.values[j].blob, gensec_skey, rid, a);
+ W_ERROR_NOT_OK_RETURN(status);
+ }
status = dsdb_attribute_drsuapi_to_ldb(ldb, schema, a, msg->elements, e);
W_ERROR_NOT_OK_RETURN(status);