Release writer lock on new parent.

This commit is contained in:
Kurt Zeilenga 1999-07-22 03:42:02 +00:00
parent 5600097ae1
commit 0ed1a76d27
2 changed files with 11 additions and 10 deletions

View file

@ -430,6 +430,9 @@ AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb) AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb)
AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb) AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb)
dnl
dnl Check for module support
dnl
ol_link_modules=no ol_link_modules=no
if test $ol_enable_modules != no ; then if test $ol_enable_modules != no ; then
AC_PATH_PROG(GLIBCONFIG, glib-config) AC_PATH_PROG(GLIBCONFIG, glib-config)

View file

@ -175,13 +175,11 @@ ldbm_back_modrdn(
"ldbm_back_modrdn: no parent, locked root\n", "ldbm_back_modrdn: no parent, locked root\n",
0, 0, 0 ); 0, 0, 0 );
}/* if ( (p_ndn = dn_parent( be, e->e_ndn )) != NULL ) else */ }
new_parent_dn = p_dn; /* New Parent unless newSuperior given */ new_parent_dn = p_dn; /* New Parent unless newSuperior given */
if ( (np_dn = newSuperior) != NULL) { if ( (np_dn = newSuperior) != NULL) {
Debug( LDAP_DEBUG_TRACE, Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: new parent requested...\n", "ldbm_back_modrdn: new parent requested...\n",
0, 0, 0 ); 0, 0, 0 );
@ -189,9 +187,7 @@ ldbm_back_modrdn(
np_ndn = dn_normalize_case( ch_strdup( np_dn ) ); np_ndn = dn_normalize_case( ch_strdup( np_dn ) );
/* newSuperior == oldParent?, if so ==> ERROR */ /* newSuperior == oldParent?, if so ==> ERROR */
/* 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? */
if( (np = dn2entry_w( be, np_ndn, &matched )) == NULL) { if( (np = dn2entry_w( be, np_ndn, &matched )) == NULL) {
@ -416,13 +412,9 @@ ldbm_back_modrdn(
Debug( LDAP_DEBUG_TRACE, Debug( LDAP_DEBUG_TRACE,
"ldbm_back_modrdn: removing old_rdn_val=%s\n", "ldbm_back_modrdn: removing old_rdn_val=%s\n",
old_rdn_val, 0, 0 ); old_rdn_val, 0, 0 );
}
}/* if (deleteoldrdn) */
} else { } else {
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: DNS DN\n", Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: DNS DN\n",
0, 0, 0 ); 0, 0, 0 );
/* XXXV3: not sure of what to do here */ /* XXXV3: not sure of what to do here */
@ -466,6 +458,7 @@ ldbm_back_modrdn(
return_results: return_results:
if( new_dn != NULL ) free( new_dn ); if( new_dn != NULL ) free( new_dn );
if( new_ndn != NULL ) free( new_ndn ); if( new_ndn != NULL ) free( new_ndn );
return_results_after: return_results_after:
/* NOTE: /* NOTE:
* new_dn and new_ndn are not deallocated because they are used by * new_dn and new_ndn are not deallocated because they are used by
@ -488,6 +481,11 @@ return_results_after:
if ( np_dn != NULL ) free( np_dn ); if ( np_dn != NULL ) free( np_dn );
if ( np_ndn != NULL ) free( np_ndn ); if ( np_ndn != NULL ) free( np_ndn );
if( np != NULL ) {
/* free new parent and writer lock */
cache_return_entry_w( &li->li_cache, np );
}
if( p != NULL ) { if( p != NULL ) {
/* free parent and writer lock */ /* free parent and writer lock */
cache_return_entry_w( &li->li_cache, p ); cache_return_entry_w( &li->li_cache, p );