| |
@@ -124,7 +124,7 @@
|
| |
|
| |
static void oc_add_nolock(struct objclass *newoc);
|
| |
static int oc_delete_nolock(char *ocname);
|
| |
- static int oc_replace_nolock(const char *ocname, struct objclass *newoc);
|
| |
+ static int oc_replace_nolock(const char *ocname, struct objclass *newoc, char *errorbuf, size_t errorbufsize);
|
| |
static int oc_check_required(Slapi_PBlock *, Slapi_Entry *, struct objclass *);
|
| |
static int oc_check_allowed_sv(Slapi_PBlock *, Slapi_Entry *e, const char *type, struct objclass **oclist);
|
| |
static int schema_delete_objectclasses(Slapi_Entry *entryBefore,
|
| |
@@ -1003,7 +1003,7 @@
|
| |
*/
|
| |
|
| |
static int
|
| |
- oc_replace_nolock(const char *ocname, struct objclass *newoc)
|
| |
+ oc_replace_nolock(const char *ocname, struct objclass *newoc, char *errorbuf, size_t errorbufsize)
|
| |
{
|
| |
struct objclass *oc, *pnext;
|
| |
int rc = LDAP_SUCCESS;
|
| |
@@ -1023,6 +1023,8 @@
|
| |
for (pnext = oc; pnext != NULL;
|
| |
oc = pnext, pnext = pnext->oc_next) {
|
| |
if (pnext->oc_name == NULL) {
|
| |
+ schema_create_errormsg(errorbuf, errorbufsize, schema_errprefix_oc,
|
| |
+ ocname, "Failed to replace objectclass");
|
| |
rc = LDAP_OPERATIONS_ERROR;
|
| |
break;
|
| |
}
|
| |
@@ -1039,6 +1041,8 @@
|
| |
break;
|
| |
|
| |
} else {
|
| |
+ schema_create_errormsg(errorbuf, errorbufsize, schema_errprefix_oc,
|
| |
+ ocname, "Can not replace objectclass that already exists");
|
| |
rc = LDAP_TYPE_OR_VALUE_EXISTS;
|
| |
break;
|
| |
}
|
| |
@@ -2699,7 +2703,7 @@
|
| |
/* insert new objectclass exactly where the old one one in the linked list*/
|
| |
if (!rc && redefined_oc) {
|
| |
pnew_oc->oc_flags |= OC_FLAG_REDEFINED_OC;
|
| |
- rc = oc_replace_nolock(pnew_oc->oc_name, pnew_oc);
|
| |
+ rc = oc_replace_nolock(pnew_oc->oc_name, pnew_oc, errorbuf, errorbufsize);
|
| |
}
|
| |
|
| |
if (!rc && !redefined_oc) {
|
| |
Description:
When replacing an objectclass, if it already exists we log an error but we do not log what objectclass it is. This commit adds the error message text.
relates: https://pagure.io/389-ds-base/issue/50653