mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Make sure that newSuperior isn't old superior
This commit is contained in:
parent
6b53b4c507
commit
2b2e406b46
@ -71,14 +71,6 @@ bdb_modrdn(
|
|||||||
newSuperior ? newSuperior->bv_val : "NULL" );
|
newSuperior ? newSuperior->bv_val : "NULL" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
|
||||||
if( newSuperior != NULL ) {
|
|
||||||
rc = LDAP_UNWILLING_TO_PERFORM;
|
|
||||||
text = "newSuperior not implemented (yet)";
|
|
||||||
goto return_results;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if( 0 ) {
|
if( 0 ) {
|
||||||
retry: /* transaction retry */
|
retry: /* transaction retry */
|
||||||
if (e != NULL) {
|
if (e != NULL) {
|
||||||
@ -384,6 +376,21 @@ retry: /* transaction retry */
|
|||||||
newSuperior->bv_val, 0, 0 );
|
newSuperior->bv_val, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* newSuperior == oldParent? */
|
||||||
|
if( dn_match( &p_ndn, nnewSuperior ) ) {
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG( BACK_LDBM, INFO, "bdb_back_modrdn: "
|
||||||
|
"new parent \"%s\" same as the old parent \"%s\"\n",
|
||||||
|
newSuperior->bv_val, p_dn.bv_val, 0 );
|
||||||
|
#else
|
||||||
|
Debug( LDAP_DEBUG_TRACE, "bdb_back_modrdn: "
|
||||||
|
"new parent \"%s\" same as the old parent \"%s\"\n",
|
||||||
|
newSuperior->bv_val, p_dn.bv_val, 0 );
|
||||||
|
#endif
|
||||||
|
newSuperior = NULL; /* ignore newSuperior */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( newSuperior != NULL ) {
|
||||||
if ( newSuperior->bv_len ) {
|
if ( newSuperior->bv_len ) {
|
||||||
np_dn = newSuperior;
|
np_dn = newSuperior;
|
||||||
np_ndn = nnewSuperior;
|
np_ndn = nnewSuperior;
|
||||||
@ -392,7 +399,8 @@ retry: /* transaction retry */
|
|||||||
/* newSuperior == entry being moved?, if so ==> ERROR */
|
/* newSuperior == entry being moved?, if so ==> ERROR */
|
||||||
/* Get Entry with dn=newSuperior. Does newSuperior exist? */
|
/* Get Entry with dn=newSuperior. Does newSuperior exist? */
|
||||||
|
|
||||||
rc = bdb_dn2entry_r( be, ltid, nnewSuperior, &np, NULL, 0, locker, &lock );
|
rc = bdb_dn2entry_r( be,
|
||||||
|
ltid, nnewSuperior, &np, NULL, 0, locker, &lock );
|
||||||
|
|
||||||
switch( rc ) {
|
switch( rc ) {
|
||||||
case 0:
|
case 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user