https://bugs.openldap.org/show_bug.cgi?id=9272
Issue ID: 9272 Summary: Invalid search results for subordinate/glued database Product: OpenLDAP Version: 2.4.47 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: overlays Assignee: bugs@openldap.org Reporter: grapvar@gmail.com Target Milestone: ---
Here is a trivial test case. Look at the following bunch of glued dit's/databases, declared in this order:
| suffix ou=a,ou=1,ou=T # subordinate; contains only one (top-level) entry | suffix ou=2,ou=T # subordinate; contains only one (top-level) entry | suffix ou=b,ou=1,ou=T # subordinate; contains only one (top-level) entry | suffix ou=T # master database, has two entries, top-level | ` ou=1 # ... and this child entry
let's query the united database:
| $ ldapsearch -b ou=1,ou=T -s sub '' nx | dn: ou=1,ou=T | dn: ou=a,ou=1,ou=T | dn: ou=b,ou=1,ou=T
Nice! But wait, what if ...
| $ ldapsearch -b ou=1,ou=T -s sub -E!pr=2/noprompt '' nx | dn: ou=1,ou=T | dn: ou=a,ou=1,ou=T | | # pagedresults: cookie=//////////8=
... BANG! ... | Server is unwilling to perform (53)
The problem is the glue_op_search(), which has issues
* different parts of code make different assumptions about data structures * different parts of code track state inconsistently * code that looks like a highly probably dead code
I mean that likely possible to build another bug-triggering test cases, and glue_op_search() needs not just a fix of the bug above, but intense cleaning and structuring.
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |OL_2_5_REQ
--- Comment #1 from Quanah Gibson-Mount quanah@openldap.org --- I'd suggest attaching your configuration & sample db, since both should be quite small, so a regression test can be easily crafted.
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.5.0 Component|overlays |slapd
https://bugs.openldap.org/show_bug.cgi?id=9272
--- Comment #2 from Konstantin Andreev grapvar@gmail.com --- Created attachment 735 --> https://bugs.openldap.org/attachment.cgi?id=735&action=edit test database and configuration; irrelevant portion of configuration omitted
Here they are.
https://bugs.openldap.org/show_bug.cgi?id=9272
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- (In reply to Konstantin Andreev from comment #2)
Created attachment 735 [details] test database and configuration; irrelevant portion of configuration omitted
Here they are.
tyvm!
https://bugs.openldap.org/show_bug.cgi?id=9272
--- Comment #4 from Konstantin Andreev grapvar@gmail.com --- When attending this issue, please, also respect "hidden" database flag, it will be easy to make at the same time, I suppose (filed separately as bug 9269).
Something like (incomplete)
--- a/servers/slapd/backglue.c Thu May 28 19:33:41 2020 +0300 +++ b/servers/slapd/backglue.c Fri May 29 00:17:33 2020 +0300 @@ -71,10 +71,13 @@ glue_back_select ( glueinfo *gi = (glueinfo *)on->on_bi.bi_private; int i;
for (i = gi->gi_nodes-1; i >= 0; i--) { assert( gi->gi_n[i].gn_be->be_nsuffix != NULL ); + + if (SLAP_DBHIDDEN( gi->gi_n[i].gn_be )) + continue;
if (dnIsSuffix(dn, &gi->gi_n[i].gn_be->be_nsuffix[0])) { return gi->gi_n[i].gn_be; } } @@ -472,10 +475,13 @@ glue_op_search ( Operation *op, SlapRepl btmp = gi->gi_n[i].gn_be; pdn = &gi->gi_n[i].gn_pdn; } if (!btmp || !btmp->be_search) continue; + /* assuming b0 is not hidden, otherwise we couldn't be here */ + if (SLAP_DBHIDDEN( btmp )) + continue; if (!dnIsSuffix(&btmp->be_nsuffix[0], &b1->be_nsuffix[0])) continue; if (get_no_subordinate_glue(op) && btmp != b1) continue; /* If we remembered which backend we were on before,
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.openldap.org/s | |how_bug.cgi?id=9269
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.5.0 |2.5.1
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.5.1 |2.5.3 Keywords| |reviewed
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|OL_2_5_REQ, reviewed | Target Milestone|2.5.3 |2.5.4
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |hyc@openldap.org
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|hyc@openldap.org |bugs@openldap.org Target Milestone|2.5.4 |2.6.0
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.6.0 |2.7.0
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement
--- Comment #5 from Quanah Gibson-Mount quanah@openldap.org --- Subordinate glue code currently doesn't understand paged results, needs enhancement for support
https://bugs.openldap.org/show_bug.cgi?id=9272
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |hyc@openldap.org