This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new 2b54404 Ticket 50914 - No error returned when adding an entry matching filters for a non existing automember group
2b54404 is described below
commit 2b5440402581fd0303f55118ae334ac455146fde
Author: Thierry Bordaz <tbordaz@redhat.com>
AuthorDate: Wed Feb 26 14:35:26 2020 +0100
Ticket 50914 - No error returned when adding an entry matching filters for a non existing automember group
Bug Description:
automember plugin adds matching members to a target group. If the target group
does not exist a message is logged but with SLAPI_LOG_PLUGIN level.
Fix Description:
Such situation (target group missing/deleted) is rare. It worths logging
the message, that automember did not add a member, at SLAPI_LOG_INFO
https://pagure.io/389-ds-base/pull-request/50285
Reviewed by: Mark Reynolds
Platforms tested: F30
Flag Day: no
Doc impact: no
---
.../suites/automember_plugin/automember_test.py | 46 ++++++++++++++++++++++
ldap/servers/plugins/automember/automember.c | 2 +-
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/dirsrvtests/tests/suites/automember_plugin/automember_test.py b/dirsrvtests/tests/suites/automember_plugin/automember_test.py
index eda9950..b34747e 100644
--- a/dirsrvtests/tests/suites/automember_plugin/automember_test.py
+++ b/dirsrvtests/tests/suites/automember_plugin/automember_test.py
@@ -140,6 +140,7 @@ def test_adduser(automember_fixture, topo):
assert group.is_member(user.dn)
user.delete()
+
@pytest.mark.skipif(ds_is_older("1.4.1.2"), reason="Not implemented")
def test_delete_default_group(automember_fixture, topo):
"""If memberof is enable and a user became member of default group
@@ -179,6 +180,51 @@ def test_delete_default_group(automember_fixture, topo):
user_1.delete()
topo.standalone.setLogLevel(0)
+@pytest.mark.skipif(ds_is_older("1.4.3.3"), reason="Not implemented")
+def test_no_default_group(automember_fixture, topo):
+ """If memberof is enable and a user became member of default group
+ and default group does not exist then an INFO should be logged
+
+ :id: 8882972f-fb3e-4d77-9729-0235897676bc
+ :setup: Standalone instance, enabled Auto Membership Plugin
+ :steps:
+ 1. Enable memberof plugin
+ 2. Set errorlog level to 0 (default)
+ 3. delete the default group
+ 4. Create a user
+ 5. Retrieve message in log
+ :expectedresults:
+ 1. Should be success
+ 2. Should be success
+ 3. Should be success
+ 4. Should be success
+ 5. Should be success
+ """
+
+ (group, automembers, automember) = automember_fixture
+
+ from lib389.plugins import MemberOfPlugin
+ memberof = MemberOfPlugin(topo.standalone)
+ memberof.enable()
+ topo.standalone.restart()
+ topo.standalone.setLogLevel(0)
+
+ # delete it if it exists
+ try:
+ group.get_attr_val_utf8('creatorsname')
+ group.delete()
+ except ldap.NO_SUCH_OBJECT:
+ pass
+ users = UserAccounts(topo.standalone, DEFAULT_SUFFIX)
+ user_1 = users.create_test_user(uid=1)
+
+ try:
+ error_lines = topo.standalone.ds_error_log.match('.*auto-membership-plugin - automember_update_member_value - group .default or target. does not exist .%s.$' % group.dn)
+ assert (len(error_lines) > 0)
+ finally:
+ user_1.delete()
+ topo.standalone.setLogLevel(0)
+
@pytest.mark.skipif(ds_is_older("1.4.1.2"), reason="Not implemented")
def test_delete_target_group(automember_fixture, topo):
"""If memberof is enabld and a user became member of target group
diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c
index 185fc26..7c875c8 100644
--- a/ldap/servers/plugins/automember/automember.c
+++ b/ldap/servers/plugins/automember/automember.c
@@ -1638,7 +1638,7 @@ automember_update_member_value(Slapi_Entry *member_e, const char *group_dn, char
if (rc != LDAP_SUCCESS || group_entry == NULL) {
if (rc == LDAP_NO_SUCH_OBJECT) {
/* the automember group (default or target) does not exist, just skip this definition */
- slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM,
+ slapi_log_err(SLAPI_LOG_INFO, AUTOMEMBER_PLUGIN_SUBSYSTEM,
"automember_update_member_value - group (default or target) does not exist (%s)\n",
group_dn);
rc = 0;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/389-commits@lists.fedoraproject.org
No comments:
Post a Comment