]> git.sur5r.net Git - openldap/commitdiff
import fix to ITS#5079
authorPierangelo Masarati <ando@openldap.org>
Wed, 8 Aug 2007 18:21:17 +0000 (18:21 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 8 Aug 2007 18:21:17 +0000 (18:21 +0000)
CHANGES
servers/slapd/back-bdb/add.c

diff --git a/CHANGES b/CHANGES
index 16a40297f9139b7b47c52d484aadcfcb2b0d32a3..bf59e8f59f3337b3eff244d00360be9e62c94731 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,7 @@ OpenLDAP 2.3.38 Engineering
        Fixed slapd select_backend/ManageDSAit (ITS#4986)
        Fixed slapd-bdb missing index warning (ITS#5037)
        Fixed slapd-bdb Quick index for ID 0 (ITS#5052)
+       Fixed slapd-bdb spurious empty DN warnings during add (ITS#5079)
        Fixed slapd-relay configuration (ITS#4322,ITS#4340)
        Fixed slapo-syncprov uninit'd vars (ITS#5048,#5049)
        Fixed libldap ldap_add_result_entry (ITS#5056)
index d0cab606eee22dd7e1aa1f331b4a2ab162c0a954..59636771f685115e769b9578b72214440eb75a84 100644 (file)
@@ -201,39 +201,41 @@ retry:    /* transaction retry */
                goto return_results;;
        }
 
-       if ( is_entry_subentry( p ) ) {
-               /* parent is a subentry, don't allow add */
-               Debug( LDAP_DEBUG_TRACE,
-                       LDAP_XSTRING(bdb_add) ": parent is subentry\n",
-                       0, 0, 0 );
-               rs->sr_err = LDAP_OBJECT_CLASS_VIOLATION;
-               rs->sr_text = "parent is a subentry";
-               goto return_results;;
-       }
-       if ( is_entry_alias( p ) ) {
-               /* parent is an alias, don't allow add */
-               Debug( LDAP_DEBUG_TRACE,
-                       LDAP_XSTRING(bdb_add) ": parent is alias\n",
-                       0, 0, 0 );
-               rs->sr_err = LDAP_ALIAS_PROBLEM;
-               rs->sr_text = "parent is an alias";
-               goto return_results;;
-       }
-
-       if ( is_entry_referral( p ) ) {
-               /* parent is a referral, don't allow add */
-               rs->sr_matched = ber_strdup_x( p->e_name.bv_val,
-                       op->o_tmpmemctx );
-               rs->sr_ref = get_entry_referrals( op, p );
-               bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
-               p = NULL;
-               Debug( LDAP_DEBUG_TRACE,
-                       LDAP_XSTRING(bdb_add) ": parent is referral\n",
-                       0, 0, 0 );
-
-               rs->sr_err = LDAP_REFERRAL;
-               rs->sr_flags = REP_MATCHED_MUSTBEFREED | REP_REF_MUSTBEFREED;
-               goto return_results;
+       if ( p != (Entry *)&slap_entry_root ) {
+               if ( is_entry_subentry( p ) ) {
+                       /* parent is a subentry, don't allow add */
+                       Debug( LDAP_DEBUG_TRACE,
+                               LDAP_XSTRING(bdb_add) ": parent is subentry\n",
+                               0, 0, 0 );
+                       rs->sr_err = LDAP_OBJECT_CLASS_VIOLATION;
+                       rs->sr_text = "parent is a subentry";
+                       goto return_results;;
+               }
+               if ( is_entry_alias( p ) ) {
+                       /* parent is an alias, don't allow add */
+                       Debug( LDAP_DEBUG_TRACE,
+                               LDAP_XSTRING(bdb_add) ": parent is alias\n",
+                               0, 0, 0 );
+                       rs->sr_err = LDAP_ALIAS_PROBLEM;
+                       rs->sr_text = "parent is an alias";
+                       goto return_results;;
+               }
+       
+               if ( is_entry_referral( p ) ) {
+                       /* parent is a referral, don't allow add */
+                       rs->sr_matched = ber_strdup_x( p->e_name.bv_val,
+                               op->o_tmpmemctx );
+                       rs->sr_ref = get_entry_referrals( op, p );
+                       bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
+                       p = NULL;
+                       Debug( LDAP_DEBUG_TRACE,
+                               LDAP_XSTRING(bdb_add) ": parent is referral\n",
+                               0, 0, 0 );
+       
+                       rs->sr_err = LDAP_REFERRAL;
+                       rs->sr_flags = REP_MATCHED_MUSTBEFREED | REP_REF_MUSTBEFREED;
+                       goto return_results;
+               }
        }
 
        if ( subentry ) {