Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1843550

Summary: The numSubordinates value doesn't always match the number of direct subordinate(s).
Product: Red Hat Enterprise Linux 8 Reporter: Simon Pichugin <spichugi>
Component: 389-ds-baseAssignee: Simon Pichugin <spichugi>
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: aadhikar, aakkiang, mreynolds, pasik, sgouvern, spichugi, tbordaz, vashirov
Target Milestone: rcKeywords: TestCaseNeeded, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: 389-ds-devel-1.4-8040020201105165416.866effaa Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:45:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Simon Pichugin 2020-06-03 14:08:38 UTC
Issue Description
The numSubordinates value should give the number of immediate subordinates.
But it could be inaccurate in cn=monitor case.

Package Version and Platform
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.2 (Ootpa)
$
$ rpm -qa | grep 389-ds-base
389-ds-base-libs-1.4.2.12-2.module+el8dsrv+6428+6e54c518.x86_64
389-ds-base-1.4.2.12-2.module+el8dsrv+6428+6e54c518.x86_64
$

Steps to reproduce
Install 389-ds 1.4.2 on RHEL 8.2 ( I can reproduce also on RHEL 7 - 389-ds 1.3.10 ).
Create a new suffix with some sample entries.
Compare the numSubordinates value on the root entry with the actual number of direct subordinate(s).
Actual results
The numSubordinates value for the root entry is always higher ( +1 ) than the number of immediate children.

There seems to be a miscalculation for the "cn=monitor" entry:
$ ldapsearch -LLL -Y EXTERNAL -H 'ldapi://%2fvar%2frun%2fslapd-<instance>.socket' -b "cn=monitor" -s base "objectclass=*" 1.1 numSubordinates 2> /dev/null
dn: cn=monitor
numSubordinates: 4

$ ldapsearch -LLL -Y EXTERNAL -H 'ldapi://%2fvar%2frun%2fslapd-<instance>.socket' -b "cn=monitor" -sone "(|(objectclass=*)(objectclass=ldapsubentry))" 1.1 2>/dev/null | grep -c ^dn:
3

Expected results
Both values should be identical.

Cloned from: https://pagure.io/389-ds-base/issue/51100

Comment 5 sgouvern 2020-11-30 08:53:35 UTC
Need more time to test it
-> moving to ITM 6

Comment 7 sgouvern 2020-12-18 10:47:15 UTC
ITM strip suspended during end of year break -> moving to ITM 10

Comment 8 Simon Pichugin 2021-01-13 17:48:41 UTC
You can try to verify it once again as the issue that was blocking this issue was fixed (presumably).

The build that should be tested - 389-ds-1.4-8040020210113163752-866effaa

Comment 9 Akshay Adhikari 2021-01-15 15:57:42 UTC
Build Tested: 389-ds-base-1.4.3.16-8.module+el8.4.0+9441+bd0f8b1f.x86_64

ldapsearch -LLL -Y EXTERNAL -H 'ldapi://%2fvar%2frun%2fslapd-<instance>.socket' -b "cn=monitor" -s base "objectclass=*" 1.1 numSubordinates 2> /dev/null
dn: cn=monitor
numSubordinates: 3

ldapsearch -LLL -Y EXTERNAL -H 'ldapi://%2fvar%2frun%2fslapd-<instance>.socket' -b "cn=monitor" -sone "(|(objectclass=*)(objectclass=ldapsubentry))" 1.1 2>/dev/null | grep -c ^dn:
3

-> Marking as verified: tested.

Comment 12 sgouvern 2021-01-18 15:18:15 UTC
As per comment 9, marking as VERIFIED

Comment 14 errata-xmlrpc 2021-05-18 15:45:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (389-ds:1.4 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1835