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.
Description of problem:
When logging an error message about invalid Auto Member rules, it would be useful to add also the name of the rule and the invalid regular expression.
Version-Release number of selected component (if applicable):
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
#
# rpm -qa | grep ipa-server
ipa-server-common-4.6.8-5.el7.noarch
ipa-server-4.6.8-5.el7.x86_64
#
How reproducible:
Always.
Steps to Reproduce:
1. Add an invalid regex to a rule.
2. Check in the LDAP errors log. The related message doesn't contain the actual invalid regex:
# grep automember_parse_regex_rule /var/log/dirsrv/slapd-<INSTANCE>/errors
[15/Oct/2021:21:44:12.657912921 +0200] - ERR - auto-membership-plugin - automember_parse_regex_rule - Unable to parse regex rule (invalid regex). Error "nothing to repeat".
#
It would be helpful to get such information to quickly find the invalid expression(s).
Especially when there are many of them:
$ grep -c automember_parse_regex_rule <SOS_REPORT>/var/log/dirsrv/slapd-<INSTANCE_NAME>/errors
72
$
Actual results:
Not enough additional information.
Expected results:
Log the invalid regexes.
Additional info:
Comment 3Florence Blanc-Renaud
2021-10-19 09:15:19 UTC
I am moving this BZ to 389ds component, as the automember plugin belongs there.
The reason that we do not log with rule and regex is invalid is becuase oif a bug where we do not return a error code when things go wrong.
diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c
index 39350ad53..b92b89bd5 100644
--- a/ldap/servers/plugins/automember/automember.c
+++ b/ldap/servers/plugins/automember/automember.c
@@ -1217,6 +1217,7 @@ automember_parse_regex_rule(char *rule_string)
"automember_parse_regex_rule - Unable to parse "
"regex rule (invalid regex). Error \"%s\".\n",
recomp_result ? recomp_result : "unknown");
+ goto bail;
}
/* Validation has passed, so create the regex rule struct and fill it in.
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 (Moderate: 389-ds-base security, 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/RHSA-2022:5239