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 );
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",
}
}
- if ( newSuperior && newSuperior->bv_val != NULL ) {
+ if ( newSuperior != NULL ) {
/* newSuperior == entry being moved?, if so ==> ERROR */
/* Get Entry with dn=newSuperior. Does newSuperior exist? */
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;
rc = SLAPD_DISCONNECT;
goto cleanup;
}
+ pnewS = &pnewSuperior;
+ nnewS = &nnewSuperior;
}
#ifdef NEW_LOGGING
goto cleanup;
}
- if( newSuperior.bv_len ) {
+ if( pnewS ) {
rc = dnPrettyNormal( NULL, &newSuperior, &pnewSuperior,
&nnewSuperior );
if( rc != LDAP_SUCCESS ) {
/* 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 ) {
{
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