]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8116 Fix handling of syncinfo intermediate message
authorOndřej Kuzník <ondra@openldap.org>
Tue, 30 Oct 2018 10:19:59 +0000 (10:19 +0000)
committerOndřej Kuzník <ondra@openldap.org>
Tue, 30 Oct 2018 10:19:59 +0000 (10:19 +0000)
clients/tools/ldapsearch.c

index 4fd08f1728754d19270d6917e27c76bc65297069..543c6cefbad16b3a0d55660f8718812ee44192cc 100644 (file)
@@ -1797,7 +1797,7 @@ static void print_syncinfo(
        ber_init2( syncinfo, data, 0 );
 
        printf(_("# SyncInfo Received: "));
-       tag = ber_skip_tag( syncinfo, &len );
+       tag = ber_peek_tag( syncinfo, &len );
        switch (tag) {
                case LDAP_TAG_SYNC_NEW_COOKIE: {
                        printf(_("new cookie\n"));
@@ -1821,7 +1821,11 @@ static void print_syncinfo(
                        } break;
                case LDAP_TAG_SYNC_REFRESH_DELETE: {
                        ber_int_t done = 1;
+
                        printf(_("refresh delete\n"));
+                       /* Skip sequence tag first */
+                       ber_skip_tag( syncinfo, &len );
+
                        tag = ber_peek_tag( syncinfo, &len );
                        if ( tag == LDAP_TAG_SYNC_COOKIE ) {
                                ber_scanf( syncinfo, "m", &cookie );
@@ -1852,7 +1856,11 @@ static void print_syncinfo(
                        } break;
                case LDAP_TAG_SYNC_REFRESH_PRESENT: {
                        ber_int_t done = 1;
+
                        printf(_("refresh present\n"));
+                       /* Skip sequence tag first */
+                       ber_skip_tag( syncinfo, &len );
+
                        tag = ber_peek_tag( syncinfo, &len );
                        if ( tag == LDAP_TAG_SYNC_COOKIE ) {
                                ber_scanf( syncinfo, "m", &cookie );
@@ -1886,6 +1894,9 @@ static void print_syncinfo(
                        BerVarray uuids;
 
                        printf(_("ID Set\n"));
+                       /* Skip sequence tag first */
+                       ber_skip_tag( syncinfo, &len );
+
                        tag = ber_peek_tag( syncinfo, &len );
                        if ( tag == LDAP_TAG_SYNC_COOKIE ) {
                                ber_scanf( syncinfo, "m", &cookie );