]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9647 Find correct sid in compare_csns() more of the time
authorOndřej Kuzník <ondra@mistotebe.net>
Fri, 29 Oct 2021 11:45:29 +0000 (12:45 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 9 Dec 2021 20:50:02 +0000 (20:50 +0000)
servers/slapd/syncrepl.c

index 9f72b33bcc8a98f8a5eb2f9b30d908b529c2cf6e..49b0b51ac3c2ca233c327d29526c5f0ed581d136 100644 (file)
@@ -1135,7 +1135,9 @@ compare_csns( struct sync_cookie *sc1, struct sync_cookie *sc2, int *which )
        *which = 0;
 
        if ( sc1->numcsns < sc2->numcsns ) {
-               *which = sc1->numcsns;
+               for ( i=0; i < sc1->numcsns && sc1->sids[i] == sc2->sids[i] ; i++ )
+                       /* Find the first one that's missing */;
+               *which = i;
                return -1;
        }