]> git.sur5r.net Git - openldap/commitdiff
ITS#6367 use correct SID in our request cookie
authorHoward Chu <hyc@openldap.org>
Sun, 15 Nov 2009 19:15:12 +0000 (19:15 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 15 Nov 2009 19:15:12 +0000 (19:15 +0000)
servers/slapd/syncrepl.c

index 4933933935cc9cea4fd97f3c51fdcdf6307be4d8..9b6d4d3c001dc7f6b2af5de1331eee865862e2c3 100644 (file)
@@ -665,6 +665,11 @@ do_syncrep1(
                        si->si_syncCookie.ctxcsn, si->si_syncCookie.rid,
                        si->si_syncCookie.sid );
        } else {
+               /* ITS#6367: recreate the cookie so it has our SID, not our peer's */
+               ch_free( si->si_syncCookie.octet_str.bv_val );
+               slap_compose_sync_cookie( NULL, &si->si_syncCookie.octet_str,
+                       si->si_syncCookie.ctxcsn, si->si_syncCookie.rid,
+                       si->si_syncCookie.sid );
                /* Look for contextCSN from syncprov overlay. */
                check_syncprov( op, si );
        }