From: Howard Chu Date: Fri, 6 Aug 2021 21:13:47 +0000 (+0100) Subject: ITS#9611 bconfig: canonicalize structuralObjectclass X-Git-Tag: OPENLDAP_REL_ENG_2_6_0~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6237ae17db997c715217309126234306086801b2;p=thirdparty%2Fopenldap.git ITS#9611 bconfig: canonicalize structuralObjectclass --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 3abfffae0e..6a0e20bd9d 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -5685,7 +5685,16 @@ config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs, } ca->ca_op = op; - co.co_name = &soc_at->a_nvals[0]; + { + ObjectClass *soc = oc_bvfind( &soc_at->a_nvals[0] ); + if ( !soc ) { + Debug( LDAP_DEBUG_TRACE, "%s: config_add_internal: " + "DN=\"%s\" invalid structural objectClass %s\n", + log_prefix, e->e_name.bv_val, soc_at->a_vals[0].bv_val ); + return LDAP_OBJECT_CLASS_VIOLATION; + } + co.co_name = &soc->soc_cname; + } coptr = ldap_avl_find( CfOcTree, &co, CfOc_cmp ); if ( coptr == NULL ) { Debug( LDAP_DEBUG_TRACE, "%s: config_add_internal: "