| |
@@ -1529,12 +1529,18 @@
|
| |
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);
|
| |
|
| |
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