From 2ed1c262a36b999a56327f73d2ca0b053699bbd9 Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Thu, 6 Jan 2011 22:59:55 +0000
Subject: [PATCH] ITS#6503

---
 CHANGES                           | 1 +
 servers/slapd/overlays/syncprov.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGES b/CHANGES
index 0f97e978fb..f59e41bc77 100644
--- a/CHANGES
+++ b/CHANGES
@@ -100,6 +100,7 @@ OpenLDAP 2.4.24 Engineering
 	Fixed slapo-syncprov to refresh if context is dirty (ITS#6710)
 	Fixed slapo-syncprov CSN updates to all replicas (ITS#6718)
 	Fixed slapo-syncprov sessionlog ordering (ITS#6716)
+	Fixed slapo-syncprov sessionlog with adds (ITS#6503)
 	Fixed slapo-translucent entry leak (ITS#6746)
 	Fixed contrib/autogroup LDAP URI with attribute filter (ITS#6536)
 	Fixed contrib/autogroup install location (ITS#6684)
diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c
index ff562d3dde..4ccc01a92c 100644
--- a/servers/slapd/overlays/syncprov.c
+++ b/servers/slapd/overlays/syncprov.c
@@ -1641,6 +1641,8 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl,
 			delcsn[0].bv_len = se->se_csn.bv_len;
 			delcsn[0].bv_val[delcsn[0].bv_len] = '\0';
 		} else {
+			if ( se->se_tag == LDAP_REQ_ADD )
+				continue;
 			nmods++;
 			j = num - nmods;
 		}
@@ -1930,7 +1932,7 @@ syncprov_op_response( Operation *op, SlapReply *rs )
 		}
 
 		/* Add any log records */
-		if ( si->si_logs && op->o_tag != LDAP_REQ_ADD ) {
+		if ( si->si_logs ) {
 			syncprov_add_slog( op );
 		}
 leave:		ldap_pvt_thread_mutex_unlock( &si->si_resp_mutex );
-- 
GitLab