Commit c4b432cb authored by Howard Chu's avatar Howard Chu
Browse files

Fix newSuperior handling. Back out previous commit.

parent 04ce28cf
......@@ -268,7 +268,7 @@ retry: /* transaction retry */
new_parent_dn = &p_dn; /* New Parent unless newSuperior given */
if ( newSuperior->bv_val != NULL ) {
if ( newSuperior != NULL ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_modrdn: new parent \"%s\" requested...\n",
newSuperior->bv_val, 0, 0 );
......
......@@ -281,7 +281,7 @@ ldbm_back_modrdn(
new_parent_dn = &p_dn; /* New Parent unless newSuperior given */
if ( newSuperior->bv_val != NULL ) {
if ( newSuperior != NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_back_modrdn: new parent \"%s\" requested\n",
......@@ -314,7 +314,7 @@ ldbm_back_modrdn(
}
}
if ( newSuperior && newSuperior->bv_val != NULL ) {
if ( newSuperior != NULL ) {
/* newSuperior == entry being moved?, if so ==> ERROR */
/* Get Entry with dn=newSuperior. Does newSuperior exist? */
......
......@@ -51,11 +51,11 @@ do_modrdn(
struct berval pdn = { 0, NULL };
struct berval pnewrdn = { 0, NULL };
struct berval pnewSuperior = { 0, NULL };
struct berval pnewSuperior = { 0, NULL }, *pnewS = NULL;
struct berval ndn = { 0, NULL };
struct berval nnewrdn = { 0, NULL };
struct berval nnewSuperior = { 0, NULL };
struct berval nnewSuperior = { 0, NULL }, *nnewS = NULL;
Backend *be;
Backend *newSuperior_be = NULL;
......@@ -136,6 +136,8 @@ do_modrdn(
rc = SLAPD_DISCONNECT;
goto cleanup;
}
pnewS = &pnewSuperior;
nnewS = &nnewSuperior;
}
#ifdef NEW_LOGGING
......@@ -249,7 +251,7 @@ do_modrdn(
goto cleanup;
}
if( newSuperior.bv_len ) {
if( pnewS ) {
rc = dnPrettyNormal( NULL, &newSuperior, &pnewSuperior,
&nnewSuperior );
if( rc != LDAP_SUCCESS ) {
......@@ -306,7 +308,7 @@ do_modrdn(
/* Make sure that the entry being changed and the newSuperior are in
* the same backend, otherwise we return an error.
*/
if( newSuperior.bv_len ) {
if( pnewS ) {
newSuperior_be = select_backend( &nnewSuperior, 0, 0 );
if ( newSuperior_be != be ) {
......@@ -341,7 +343,7 @@ do_modrdn(
{
if ( (*be->be_modrdn)( be, conn, op, &pdn, &ndn,
&pnewrdn, &nnewrdn, deloldrdn,
&pnewSuperior, &nnewSuperior ) == 0
pnewS, nnewS ) == 0
#ifdef SLAPD_MULTIMASTER
&& ( !be->be_update_ndn.bv_len || !repl_user )
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment