[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-09-26 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

Quanah Gibson-Mount  changed:

   What|Removed |Added

 Status|IN_PROGRESS |RESOLVED
 Resolution|--- |TEST

--- Comment #12 from Quanah Gibson-Mount  ---
  • 3676f3ad 
by Ondřej Kuzník at 2023-07-19T14:53:47+00:00 
ITS#10060 Return tag of last message if all=LDAP_MSG_ALL


  • 4b7b2172 
by Ondřej Kuzník at 2023-07-19T14:53:47+00:00 
ITS#10060 Try harder to find a finished operation with msgid=LDAP_RES_ANY

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-06-21 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #11 from Ondřej Kuzník  ---
The new MR now does the opposite, could you test on your end (python-ldap test
suite seems to work for me but confirmation welcome).
https://git.openldap.org/openldap/openldap/-/merge_requests/631

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-06-12 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

Quanah Gibson-Mount  changed:

   What|Removed |Added

   Keywords|needs_review|
   Target Milestone|--- |2.7.0

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-06-01 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #10 from Howard Chu  ---
Btw, 25 years - this is the commit I was thinking of
fa2da63ca4d3f48793de5421f56c23c1c6d794ab

https://git.openldap.org/openldap/openldap/-/commit/fa2da63ca4d3f48793de5421f56c23c1c6d794ab#8279d1f082df577a47e8773fdbc789b641689858

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-06-01 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #9 from David Härdeman  ---
Actually, I think changing both cases to return 101 might make more sense.

As shown by Ondřej's PR, ldapsearch already expects that to be the return code
(and has done so for a long time).

Further, python-ldap expects 101 to be the return code as well (as do projects
using python-ldap, implicitly).

While I understand the appeal of not changing the status quo, not fixing this
runs the risk of difficult to reproduce bugs, especially in threaded
environments where the return code might differ depending on network delays and
the order in which different operations complete (and are processed).

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-06-01 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #8 from Ondřej Kuzník  ---
On Wed, May 31, 2023 at 08:05:58PM +, openldap-...@openldap.org wrote:
> I'm inclined to make this a WONTFIX. Changing a 20+ year old library behavior
> just seems like a bad idea at this point. (Note that this in particular was
> also one of the behaviors that was explicitly changed between UMich LDAP and
> OpenLDAP 1.0. Bugs here go back a long way and any changes will have
> far-reaching effects.)

That's also an option if we don't want to pull it in 2.7. In that case I
could put something like this in the BUGS section of the manpage:

 8< 

BUGS

When there are multiple messages in **result including a result message
(common with searches), the return value of ldap_result(, MSG_ALL,) will
vary depending on various factors. Some implementations have started
relying on this behaviour and as such it is unlikely to be be fixed in
the 2.x release series. To get the message type you're looking for, use
ldap_first_message() or ldap_parse_result() as needed.

 8< 

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-05-31 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #7 from Howard Chu  ---
I'm inclined to make this a WONTFIX. Changing a 20+ year old library behavior
just seems like a bad idea at this point. (Note that this in particular was
also one of the behaviors that was explicitly changed between UMich LDAP and
OpenLDAP 1.0. Bugs here go back a long way and any changes will have
far-reaching effects.)

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-05-31 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #6 from David Härdeman  ---
Changing it to LDAP_RES_SEARCH_ENTRY (100) in both cases will (probably) cause
more breakage though.

For example, python-ldap CI tests will break...as might third party software
which uses python-ldap.

Not saying it's wrong to change to LDAP_RES_SEARCH_ENTRY (the C LDAP API draft
you cited seems pretty clear), but I just wanted to point out that more
downstream software will have to be changed...

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-05-30 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

Ondřej Kuzník  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|b...@openldap.org   |on...@mistotebe.net
 Status|UNCONFIRMED |IN_PROGRESS

--- Comment #5 from Ondřej Kuzník  ---
https://git.openldap.org/openldap/openldap/-/merge_requests/627

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-05-30 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #4 from Ondřej Kuzník  ---
> ldap_result rc" (101 vs 100, it should be 101 in both cases)

BTW this should be LDAP_RES_SEARCH_ENTRY (100) in both cases as outlined in the
draft - as that's the first message in result.

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-05-30 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #3 from Ondřej Kuzník  ---
Hi David,
thanks for the report.

You are correct, while the ldap_result manpage doesn't specify whether either
behaviour is correct, the C LDAP API draft[0] is quite explicit about the
result being "the type of the first result returned in the res parameter."

On the other hand, ldapsearch depends on the current behaviour so it might need
updating in lockstep.

[0].
https://datatracker.ietf.org/doc/html/draft-ietf-ldapext-ldap-c-api-05#section-13

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-05-26 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #2 from David Härdeman  ---
The output from the test case is:
ldap_search_ext = 0, msgid = 2
ldap_search_ext = 0, msgid = 3
ldap_result rc = 101, msgid = 3, result is now 0x0x55b2ddc53990
Message: ID 3, type 100
Message: ID 3, type 100
Message: ID 3, type 100
Message: ID 3, type 101
ldap_result rc = 100, msgid = 2, result is now 0x0x55b2ddc538f0
Message: ID 2, type 100
Message: ID 2, type 100
Message: ID 2, type 100
Message: ID 2, type 101

Note the difference in "ldap_result rc" (101 vs 100, it should be 101 in both
cases)

-- 
You are receiving this mail because:
You are on the CC list for the issue.

[Issue 10060] libldap: ldap_result return value differs depending on if a search response is already in the response list or not

2023-05-26 Thread openldap-its
https://bugs.openldap.org/show_bug.cgi?id=10060

--- Comment #1 from David Härdeman  ---
Created attachment 969
  --> https://bugs.openldap.org/attachment.cgi?id=969=edit
Test case

-- 
You are receiving this mail because:
You are on the CC list for the issue.