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 cdd6267 Ticket 50898 - ldclt core dumped when run with -e genldif option
cdd6267 is described below
commit cdd62676376ccd0b9dde75fe400928d9346088ef
Author: Thierry Bordaz <tbordaz(a)redhat.com>
AuthorDate: Fri Feb 14 15:38:19 2020 +0100
Ticket 50898 - ldclt core dumped when run with -e genldif option
Bug Description:
ldctl can generate ldif file. If the template file or option
-e <objectclass> (person/InetOrgPerson/emailPerson) is missing,
then the attribute value is not set.
When dereferencing attribute.mod_values it crashes
Fix Description:
Test that attribute.mod_values is set. If it is not (tha
means the objectclass value was not provided) and return an error
https://pagure.io/389-ds-base/issue/50898
Reviewed by: ?
Platforms tested: F29
Flag Day: no
Doc impact: no
---
ldap/servers/slapd/tools/ldclt/ldapfct.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c
b/ldap/servers/slapd/tools/ldclt/ldapfct.c
index dbfc553..8ed83cc 100644
--- a/ldap/servers/slapd/tools/ldclt/ldapfct.c
+++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c
@@ -1529,12 +1529,18 @@ buildNewEntry(
nbAttribs = 0; /* No attributes yet */
attribute.mod_op = LDAP_MOD_ADD;
attribute.mod_type = "objectclass";
+ attribute.mod_values = NULL;
if (mctx.mode & OC_PERSON)
attribute.mod_values = strList1("person");
if (mctx.mode & OC_EMAILPERSON)
attribute.mod_values = strList1("emailPerson");
if (mctx.mode & OC_INETORGPRSON) /*JLS 07-11-00*/
attribute.mod_values = strList1("inetOrgPerson"); /*JLS 07-11-00*/
+ if (attribute.mod_values == NULL) {
+ printf("ldclt[%d]: T%03d: attribute objectclass not defined (supported
values are person/emailPerson/inetOrgPerson)\n",
+ mctx.pid, tttctx->thrdNum);
+ return -1;
+ }
if (addAttrib(attrs, nbAttribs++, &attribute) < 0)
return (-1);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.