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 1759142

Summary: No error returned when adding an entry matching filters for a non existing automember group
Product: Red Hat Enterprise Linux 7 Reporter: sgouvern
Component: 389-ds-baseAssignee: thierry bordaz <tbordaz>
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.7CC: mreynolds, nkinder, pasik, spichugi, tbordaz, vashirov
Target Milestone: rcKeywords: TestCaseProvided
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.10.2-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:46:50 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 sgouvern 2019-10-07 13:21:14 UTC
Description of problem: 
When creating an entry with attributes matching the automemberFilter of an auto membership definition, but for which the autoMemberDefaultGroup doesn't exist, the entry is created successfully, without any error or even without warning

Version-Release number of selected component (if applicable):
389-ds-base-1.3.9.1-10.el7.x86_64
and 389-ds-base-1.3.10.1-2.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. enable the memberof plugin 
2. Add a configuration entry for the auto Membership Plugin, autoMemberDefaultGroup value being a non existing group. For example :
dn: cn=test users,cn=Auto Membership Plugin,cn=plugins,cn=config
objectclass: autoMemberDefinition
autoMemberScope: ou=People,dc=example,dc=com
autoMemberFilter: objectclass=nsView
autoMemberDefaultGroup: cn=invalid group,ou=Groups,dc=example,dc=com
autoMemberGroupingAttr: uniqueMember:dn

cn=invalid group,ou=Groups,dc=example,dc=com does not exist

3. create en entry part of the autoMemberScope of the auto Membership plugin definition, having an attribute matching the autoMemberFilter. For example :
dn: ou=test view,ou=People,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
objectClass: nsView
ou: test view
description: test view

Actual results:
The entry is added successfully

Expected results:
The operation should be rejected, or at least an error message should be returned/logged to warn that the group to which the entry should be added does not exist.


Additional info:
linked to https://pagure.io/389-ds-base/issue/50077 ??

Comment 2 thierry bordaz 2019-12-16 10:22:06 UTC
I think it is not related to https://pagure.io/389-ds-base/issue/50077, #50077 is the ability to trigger automember upon a MOD for which the resulting target entry match the automember config.

I think this bug requested behavior may be in conflict with https://pagure.io/389-ds-base/issue/50282
  - If the automember target group does not exist return an error
  - But if the original operation is a DEL of the target group, it should succeeds even if some former members still match the group membership.

I would prefer the second option you propose to log a message and let the operation be successful

Comment 3 thierry bordaz 2019-12-16 10:43:21 UTC
As a follow up of previous update, #50282 should already log a warning when the member entry is added:
    ==> automember_update_member_value - group (default or target) does not exist (%s)

But this is logged only with errorlog-level=65536 (plugin). So the log could easily be changed to SLAP_LOG_WARNING

Comment 4 thierry bordaz 2020-02-26 13:32:09 UTC
upstream ticket https://pagure.io/389-ds-base/issue/50914

Comment 5 thierry bordaz 2020-02-27 14:55:43 UTC
fix pushed upstream -> POST

Comment 8 sgouvern 2020-04-06 13:02:20 UTC
Verified with 389-ds-base: 1.3.10.2-1.el7

# py.test -v ds/dirsrvtests/tests/suites/automember_plugin/automember_test.py::test_no_default_group
=============================================== test session starts ================================================
platform linux -- Python 3.6.8, pytest-5.4.1, py-1.8.1, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-3.10.0-1127.el7.x86_64-x86_64-with-redhat-7.8-Maipo', 'Packages': {'pytest': '5.4.1', 'py': '1.8.1', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.8.0', 'html': '2.1.1'}}
389-ds-base: 1.3.10.2-1.el7
nss: 3.44.0-7.el7_7
nspr: 4.21.0-1.el7
openldap: 2.4.44-21.el7_6
cyrus-sasl: 2.1.26-23.el7
FIPS: disabled
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests, inifile: pytest.ini
plugins: metadata-1.8.0, html-2.1.1
collected 1 item                                                                                                   

ds/dirsrvtests/tests/suites/automember_plugin/automember_test.py::test_no_default_group PASSED               [100%]

================================================ 1 passed in 24.70s ================================================

Message in the errors log : 
[06/Apr/2020:08:01:07.698970098 -0400] - INFO - auto-membership-plugin - automember_update_member_value - group (default or target) does not exist (cn=invalid group,ou=Groups,dc=example,dc=com)

=> Marking as VERIFIED and opening an RFE (bz1821263) to have too an explicit message on the client side.

Comment 10 errata-xmlrpc 2020-09-29 19:46:50 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-2020:3894