summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-02 18:18:33 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-02 18:19:56 +1000
commit9f031352c6e9439922284fc853611964b33ea4af (patch)
tree3a7047c9f2ad735d08f9937f08de56a491970f36 /source4/dsdb
parentb5f63160d474b1fc8484a1a9112aa4f248d1e814 (diff)
downloadsamba-9f031352c6e9439922284fc853611964b33ea4af.tar.gz
samba-9f031352c6e9439922284fc853611964b33ea4af.tar.bz2
samba-9f031352c6e9439922284fc853611964b33ea4af.zip
traverse the ac list in reverse order
items are added to the linked attribute list using DLIST_ADD(), which means to commit them to the database in the same order they came from the server we need to walk the list backwards when we traverse it
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/linked_attributes.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index 561fc66941..3486b7f229 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -1243,7 +1243,12 @@ static int linked_attributes_end_transaction(struct ldb_module *module)
talloc_get_type(ldb_module_get_private(module), struct la_private);
struct la_context *ac;
- for (ac=la_private->la_list; ac; ac=ac->next) {
+ /* walk the list backwards, to do the first entry first, as we
+ * added the entries with DLIST_ADD() which puts them at the
+ * start of the list */
+ for (ac = la_private->la_list; ac && ac->next; ac=ac->next) ;
+
+ for (; ac; ac=ac->prev) {
int ret;
ac->req = NULL;
ret = la_do_mod_request(module, ac);