From 3676f3ad69f67256b9657ca3fd590248cda5fa5c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Wed, 21 Jun 2023 10:34:32 +0100 Subject: [PATCH] ITS#10060 Return tag of last message if all=LDAP_MSG_ALL --- libraries/libldap/result.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 40ff1c1722..f5a5868860 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -295,7 +295,11 @@ wait4msg( #endif /* LDAP_DEBUG */ if ( ( *result = chkResponseList( ld, msgid, all ) ) != NULL ) { - rc = (*result)->lm_msgtype; + if ( all == LDAP_MSG_ALL && (*result)->lm_chain ) { + rc = (*result)->lm_chain_tail->lm_msgtype; + } else { + rc = (*result)->lm_msgtype; + } } else { int lc_ready = 0; @@ -1082,7 +1086,7 @@ nextresp2: chain_head->lm_chain_tail = newmsg; *result = chkResponseList( ld, msgid, all ); ld->ld_errno = LDAP_SUCCESS; - return( (*result)->lm_msgtype ); + return( (*result)->lm_chain_tail->lm_msgtype ); } } #endif /* LDAP_CONNECTIONLESS */ -- 2.47.3