From c7ef49c8ce6b7db698af5b473138e012b0cd2b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Tue, 30 Oct 2018 10:19:59 +0000 Subject: [PATCH] ITS#8116 Fix handling of syncinfo intermediate message --- clients/tools/ldapsearch.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 4fd08f1728..543c6cefba 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -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 );