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 2189946

Summary: RFE support of slapi_memberof for plugins/core server
Product: Red Hat Enterprise Linux 9 Reporter: thierry bordaz <tbordaz>
Component: 389-ds-baseAssignee: thierry bordaz <tbordaz>
Status: CLOSED ERRATA QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: unspecified Docs Contact: Evgenia Martynyuk <emartyny>
Priority: high    
Version: 9.3CC: bsmejkal, emartyny, idm-ds-dev-bugs, mreynolds, vashirov
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 9.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: 389-ds-base-2.3.4-3.el9 Doc Type: Enhancement
Doc Text:
.New `slapi_memberof()` plug-in function is now available for Directory Server plug-ins and client applications The new `slapi_memberof()` function retrieves distinguished names (DNs) of groups to which the given entry belongs directly or indirectly. Previously, MemberOf, Referential Integrity, and ACL plug-ins implemented their own mechanism to retrieve such groups. With this update, you can use the `slapi_memberof()` function that introduces a unified mechanism to return group DNs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:25:18 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Deadline: 2023-07-17   

Description thierry bordaz 2023-04-26 14:21:46 UTC
Description of problem:
The upstream RFE https://github.com/389ds/389-ds-base/issues/5156 implements a new slapi function slapi_memberof.
        
This function is described in https://www.port389.org/docs/389ds/design/slapi_memberof.html
For a given target entry, it allows the caller to retrieve all entries that have a membership relation to that entry.

Typically, retrieving the groups that the given entry is memberof.

Comment 2 thierry bordaz 2023-04-26 14:37:38 UTC
This RFE was pushed upstream -> POST

Currently
  RFE code was pushed upstream
  RFE tests testing recomputation were pushed upstream

Next
  RFE tests testing reuse memberof results will be reviewed soon

Comment 3 bsmejkal 2023-07-25 13:33:17 UTC
Hi Thierry,
all tests related to the RFE fail with:

dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_simple - FileNotFoundError: [Errno 2] No such file or directory: '/mnt/tests/rhds/tests/upstream/ds/ldap/servers/slapd/haproxy.h'

The test preparation collects the missing haproxy.h file, which is related to another RFE (https://github.com/389ds/389-ds-base/issues/3527). 
It was postponed to RHEL 9.4 as the proxy feature is quite extensive and therefore it is included in branch 2.4.

Since it is just an include, after removing the haproxy file, all tests pass.


I want to confirm if removing the haproxy from include part in the tests would be a suitable change for 389-ds-base-2.3 branch or if it might introduce issues elsewhere.
Thanks!

Comment 4 thierry bordaz 2023-07-26 13:47:54 UTC
I think the build is missing some others commits (at least https://github.com/389ds/389-ds-base/commit/eaabdd2a34d4d8e3e70ac1d6d112927d896c4d73):
MAIN
git log --oneline | grep 5156
eaabdd2a3 Issue 5156 - (cont) RFE slapi_memberof reusing memberof values (#5744)
ea0ed1f51 Issue 5156 - build warnings (#5758)
881cade75 Issue 5156 - fix build breakage from slapi-memberof commit
9a05477f6 Issue 5156 - RFE that implement slapi_memberof (#5694)

RHEL-9.3
it log --oneline | grep 5156
b7dccdc0b Issue 5156 - RFE that implement slapi_memberof (#5694)

As temporary workaround, you may try to add 'haproxy.h' in https://github.com/389ds/389-ds-base/blob/main/dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py#L88

Comment 5 bsmejkal 2023-08-07 19:04:00 UTC
The tests will pass with the mentioned workarounds.
But I am moving it to ASSIGNED as per comment #c4 because there are few commits missing.

Comment 11 bsmejkal 2023-08-11 10:39:41 UTC
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.9.17, pytest-7.4.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.9.17', 'Platform': 'Linux-5.14.0-350.el9.x86_64-x86_64-with-glibc2.34', 'Packages': {'pytest': '7.4.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '3.0.0', 'html': '3.2.0', 'libfaketime': '0.1.2', 'flaky': '3.7.0'}}
389-ds-base: 2.3.6-2.el9
nss: 3.90.0-3.el9_2
nspr: 4.35.0-3.el9_2
openldap: 2.6.3-1.el9
cyrus-sasl: 2.1.27-21.el9
FIPS: disabled
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests
configfile: pytest.ini
plugins: metadata-3.0.0, html-3.2.0, libfaketime-0.1.2, flaky-3.7.0
collected 21 items                                                                                                                                                                                                                           

dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_simple PASSED                                                                                                                                     [  4%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_allbackends_on PASSED                                                                                                                             [  9%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_allbackends_off PASSED                                                                                                                            [ 14%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_memberattr PASSED                                                                                                                                 [ 19%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_scope PASSED                                                                                                                                      [ 23%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_excludescope PASSED                                                                                                                               [ 28%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_skip_nested PASSED                                                                                                                                [ 33%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_maxgroup PASSED                                                                                                                                   [ 38%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_1 PASSED                                                                                                                        [ 42%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_2 PASSED                                                                                                                        [ 47%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_3 PASSED                                                                                                                        [ 52%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_4 PASSED                                                                                                                        [ 57%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_5 PASSED                                                                                                                        [ 61%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_6 PASSED                                                                                                                        [ 66%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_7 PASSED                                                                                                                        [ 71%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_8 PASSED                                                                                                                        [ 76%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_9 PASSED                                                                                                                        [ 80%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_10 PASSED                                                                                                                       [ 85%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_if_possible_11 PASSED                                                                                                                       [ 90%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_only_1 PASSED                                                                                                                               [ 95%]
dirsrvtests/tests/suites/slapi_memberof/basic_interface_test.py::test_slapi_memberof_reuse_only_2 PASSED                                                                                                                               [100%]

=============================================================================================== 21 passed, 1568 warnings in 159.94s (0:02:39) ================================================================================================

Marking as Verified:Tested.

Comment 14 bsmejkal 2023-08-11 10:48:57 UTC
As per comment #c11 marking as VERIFIED.

Comment 17 errata-xmlrpc 2023-11-07 08:25:18 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-base 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-2023:6350