]> git.sur5r.net Git - openldap/commitdiff
rootdn can exceed limit on number of dynamic objects
authorPierangelo Masarati <ando@openldap.org>
Sat, 14 Jan 2006 11:17:10 +0000 (11:17 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 14 Jan 2006 11:17:10 +0000 (11:17 +0000)
servers/slapd/overlays/dds.c

index 8cf4e57d7d600d0b7e90dbaa909b1cd6e2900b2f..918bda554a90f30f6cef30bc5801f28a5ef7fe7b 100644 (file)
@@ -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 );