From: Pierangelo Masarati Date: Sat, 14 Jan 2006 11:17:10 +0000 (+0000) Subject: rootdn can exceed limit on number of dynamic objects X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~315 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=63e80ef12e17754bf50cc8a4366f611e093ac298;p=openldap rootdn can exceed limit on number of dynamic objects --- diff --git a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c index 8cf4e57d7d..918bda554a 100644 --- a/servers/slapd/overlays/dds.c +++ b/servers/slapd/overlays/dds.c @@ -389,16 +389,18 @@ dds_op_add( Operation *op, SlapReply *rs ) char ttlbuf[] = "31557600"; char tsbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; struct berval bv; - - ldap_pvt_thread_mutex_lock( &di->di_mutex ); - rs->sr_err = ( di->di_max_dynamicObjects && - di->di_num_dynamicObjects >= di->di_max_dynamicObjects ); - ldap_pvt_thread_mutex_unlock( &di->di_mutex ); - if ( rs->sr_err ) { - op->o_bd->bd_info = (BackendInfo *)on->on_info; - send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, - "too many dynamicObjects in context" ); - return rs->sr_err; + + if ( !be_isroot_dn( op->o_bd, &op->o_req_ndn ) ) { + ldap_pvt_thread_mutex_lock( &di->di_mutex ); + rs->sr_err = ( di->di_max_dynamicObjects && + di->di_num_dynamicObjects >= di->di_max_dynamicObjects ); + ldap_pvt_thread_mutex_unlock( &di->di_mutex ); + if ( rs->sr_err ) { + op->o_bd->bd_info = (BackendInfo *)on->on_info; + send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM, + "too many dynamicObjects in context" ); + return rs->sr_err; + } } ttl = DDS_DEFAULT_TTL( di );