]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
bdb modrdn fix (ITS#2336)
authorKurt Zeilenga <kurt@openldap.org>
Fri, 28 Feb 2003 05:48:07 +0000 (05:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 28 Feb 2003 05:48:07 +0000 (05:48 +0000)
CHANGES
servers/slapd/back-bdb/modrdn.c

diff --git a/CHANGES b/CHANGES
index c57bba2c38e21126828fc1c701627133215ebe13..2cb4437ca9114e5477c72524b9134220dde310c3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ OpenLDAP 2.1.14 Engineering
        Fixed back-bdb bdb_cache_find_entry* retry bug
        Fixed back-bdb log message bug
        Fixed back-bdb group/atttribute txn code (ITS#2122)
+       Fixed back-bdb modrdn subtree rename bug (ITS#2336)
        Fixed client tools krb4 handling
        Updated slapadd to complain about holes in the DIT
        Build Environment
index 783bd70fc59e7740069cf977241549cd67486534..94745198f785730043f8d652474f1cf43f896e6e 100644 (file)
@@ -212,6 +212,41 @@ retry:     /* transaction retry */
                goto return_results;
        }
 
+#ifndef BDB_HIER
+       rc = bdb_dn2id_children( be, ltid, &e->e_nname, 0 );
+       if ( rc != DB_NOTFOUND ) {
+               switch( rc ) {
+               case DB_LOCK_DEADLOCK:
+               case DB_LOCK_NOTGRANTED:
+                       goto retry;
+               case 0:
+#ifdef NEW_LOGGING
+                       LDAP_LOG ( OPERATION, DETAIL1, 
+                               "<=- bdb_modrdn: non-leaf %s\n", dn->bv_val, 0, 0 );
+#else
+                       Debug(LDAP_DEBUG_ARGS,
+                               "<=- bdb_modrdn: non-leaf %s\n",
+                               dn->bv_val, 0, 0);
+#endif
+                       rc = LDAP_NOT_ALLOWED_ON_NONLEAF;
+                       text = "subtree rename not supported";
+                       break;
+               default:
+#ifdef NEW_LOGGING
+                       LDAP_LOG ( OPERATION, ERR, 
+                               "<=- bdb_modrdn: has_children failed %s (%d)\n",
+                               db_strerror(rc), rc, 0 );
+#else
+                       Debug(LDAP_DEBUG_ARGS,
+                               "<=- bdb_modrdn: has_children failed: %s (%d)\n",
+                               db_strerror(rc), rc, 0 );
+#endif
+                       rc = LDAP_OTHER;
+                       text = "internal error";
+               }
+               goto return_results;
+       }
+#endif
        if (!manageDSAit && is_entry_referral( e ) ) {
                /* parent is a referral, don't allow add */
                /* parent is an alias, don't allow add */
@@ -412,7 +447,7 @@ retry:      /* transaction retry */
                /*  newSuperior == oldParent? */
                if( dn_match( &p_ndn, nnewSuperior ) ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG( BACK_LDBM, INFO, "bdb_back_modrdn: "
+                       LDAP_LOG( BACK_BDB, INFO, "bdb_back_modrdn: "
                                "new parent \"%s\" same as the old parent \"%s\"\n",
                                newSuperior->bv_val, p_dn.bv_val, 0 );
 #else