mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 01:59:38 -05:00
improve previous commit (check result of structural_class())
This commit is contained in:
parent
c36904bda5
commit
4a73490186
1 changed files with 20 additions and 5 deletions
|
|
@ -4302,16 +4302,31 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs,
|
|||
char textbuf[ SLAP_TEXT_BUFLEN ];
|
||||
const char *text = textbuf;
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "%s: config_add_internal: "
|
||||
"DN=\"%s\" no structural objectClass\n",
|
||||
op ? op->o_log_prefix : "", e->e_name.bv_val, 0 );
|
||||
|
||||
structural_class( oc_at->a_nvals, &soc, NULL, &text, textbuf, sizeof(textbuf), NULL );
|
||||
/* FIXME: check result */
|
||||
rc = structural_class( oc_at->a_nvals, &soc, NULL,
|
||||
&text, textbuf, sizeof(textbuf), NULL );
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "%s: config_add_internal: "
|
||||
"DN=\"%s\" no structural objectClass (%s)\n",
|
||||
op ? op->o_log_prefix : "", e->e_name.bv_val, text );
|
||||
return rc;
|
||||
}
|
||||
attr_merge_one( e, slap_schema.si_ad_structuralObjectClass, &soc->soc_cname, NULL );
|
||||
soc_at = attr_find( e->e_attrs, slap_schema.si_ad_structuralObjectClass );
|
||||
if ( soc_at == NULL ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "%s: config_add_internal: "
|
||||
"DN=\"%s\" no structural objectClass; "
|
||||
"unable to merge computed class %s\n",
|
||||
op ? op->o_log_prefix : "", e->e_name.bv_val,
|
||||
soc->soc_cname.bv_val );
|
||||
return LDAP_OBJECT_CLASS_VIOLATION;
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "%s: config_add_internal: "
|
||||
"DN=\"%s\" no structural objectClass; "
|
||||
"computed objectClass %s merged\n",
|
||||
op ? op->o_log_prefix : "", e->e_name.bv_val,
|
||||
soc->soc_cname.bv_val );
|
||||
}
|
||||
|
||||
/* Fake the coordinates based on whether we're part of an
|
||||
|
|
|
|||
Loading…
Reference in a new issue