This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.3.10
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.3.10 by this push:
new b89df90 Issue 50653 - objectclass parsing fails to log error message text
b89df90 is described below
commit b89df902174e93a75a6e25a0f1769fb790faf22b
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Wed Oct 16 14:16:55 2019 -0400
Issue 50653 - objectclass parsing fails to log error message text
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
Reviewed by: abbra(Thanks!)
---
ldap/servers/slapd/schema.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c
index 68c9834..e4f0d66 100644
--- a/ldap/servers/slapd/schema.c
+++ b/ldap/servers/slapd/schema.c
@@ -126,7 +126,7 @@ static struct dse *pschemadse = NULL;
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,
@@ -1110,7 +1110,7 @@ oc_find_oid_nolock(const char *ocoid)
*/
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;
@@ -1130,6 +1130,8 @@ oc_replace_nolock(const char *ocname, struct objclass *newoc)
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;
}
@@ -1146,6 +1148,8 @@ oc_replace_nolock(const char *ocname, struct objclass *newoc)
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;
}
@@ -2817,7 +2821,7 @@ add_oc_internal(struct objclass *pnew_oc, char *errorbuf, size_t
errorbufsize, i
/* 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) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.