Commit 582fc040 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5745

parent 4cfedb6c
......@@ -11,6 +11,7 @@ OpenLDAP 2.4.13 Engineering
Fixed slapd contextCSN pending list (ITS#5709)
Fixed slapd control criticality (ITS#5785)
Added slapd dn.this search limits (ITS#5734)
Fixed slapd error status on shutdown (ITS#5745)
Fixed slapd nameUIDPretty bitstring parsing (ITS#5750)
Fixed slapd overlay/database open with real structure (ITS#5724)
Fixed slapd parsing of read entry control (ITS#5741)
......
......@@ -584,6 +584,17 @@ bdb_db_close( BackendDB *be, ConfigReply *cr )
ber_bvarray_free( bdb->bi_db_config );
bdb->bi_db_config = NULL;
if( bdb->bi_dbenv ) {
/* Free cache locker if we enabled locking.
* TXNs must all be closed before DBs...
*/
if ( !( slapMode & SLAP_TOOL_QUICK ) && bdb->bi_cache.c_txn ) {
TXN_ABORT( bdb->bi_cache.c_txn );
bdb->bi_cache.c_txn = NULL;
}
bdb_reader_flush( bdb->bi_dbenv );
}
while( bdb->bi_databases && bdb->bi_ndatabases-- ) {
db = bdb->bi_databases[bdb->bi_ndatabases];
rc = db->bdi_db->close( db->bdi_db, 0 );
......@@ -614,13 +625,6 @@ bdb_db_close( BackendDB *be, ConfigReply *cr )
/* close db environment */
if( bdb->bi_dbenv ) {
/* Free cache locker if we enabled locking */
if ( !( slapMode & SLAP_TOOL_QUICK ) && bdb->bi_cache.c_txn ) {
TXN_ABORT( bdb->bi_cache.c_txn );
bdb->bi_cache.c_txn = NULL;
}
bdb_reader_flush( bdb->bi_dbenv );
/* force a checkpoint, but not if we were ReadOnly,
* and not in Quick mode since there are no transactions there.
*/
......
......@@ -349,11 +349,13 @@ int backend_shutdown( Backend *be )
}
if ( be->bd_info->bi_db_close ) {
be->bd_info->bi_db_close( be, NULL );
rc = be->bd_info->bi_db_close( be, NULL );
if ( rc ) return rc;
}
if( be->bd_info->bi_close ) {
be->bd_info->bi_close( be->bd_info );
rc = be->bd_info->bi_close( be->bd_info );
if ( rc ) return rc;
}
return 0;
......
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2004-2008 The OpenLDAP Foundation.
......@@ -399,7 +400,8 @@ destroy:;
}
}
slap_tool_destroy();
if ( slap_tool_destroy())
rc = EXIT_FAILURE;
return rc;
}
......
......@@ -447,7 +447,8 @@ slapadd( int argc, char **argv )
}
}
slap_tool_destroy();
if ( slap_tool_destroy())
rc = EXIT_FAILURE;
return rc;
}
......
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2004-2008 The OpenLDAP Foundation.
......@@ -166,7 +167,8 @@ destroy:;
if ( !BER_BVISNULL( &authzID ) ) {
op->o_tmpfree( authzID.bv_val, op->o_tmpmemctx );
}
slap_tool_destroy();
if ( slap_tool_destroy())
rc = EXIT_FAILURE;
return rc;
}
......
......@@ -134,6 +134,7 @@ slapcat( int argc, char **argv )
be->be_entry_close( be );
slap_tool_destroy();
if ( slap_tool_destroy())
rc = EXIT_FAILURE;
return rc;
}
......@@ -740,13 +740,16 @@ startup:;
}
}
void slap_tool_destroy( void )
int slap_tool_destroy( void )
{
int rc = 0;
if ( !dryrun ) {
if ( need_shutdown ) {
slap_shutdown( be );
if ( slap_shutdown( be ))
rc = EXIT_FAILURE;
}
slap_destroy();
if ( slap_destroy())
rc = EXIT_FAILURE;
}
#ifdef SLAPD_MODULES
if ( slapMode == SLAP_SERVER_MODE ) {
......@@ -772,4 +775,5 @@ void slap_tool_destroy( void )
if ( ldiffp && ldiffp != &dummy ) {
ldif_close( ldiffp );
}
return rc;
}
......@@ -101,6 +101,6 @@ void slap_tool_init LDAP_P((
int tool,
int argc, char **argv ));
void slap_tool_destroy LDAP_P((void));
int slap_tool_destroy LDAP_P((void));
#endif /* SLAPCOMMON_H_ */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2004-2008 The OpenLDAP Foundation.
......@@ -99,7 +100,8 @@ slapdn( int argc, char **argv )
}
}
slap_tool_destroy();
if ( slap_tool_destroy())
rc = EXIT_FAILURE;
return rc;
}
......@@ -99,6 +99,7 @@ slapindex( int argc, char **argv )
(void) be->be_entry_close( be );
slap_tool_destroy();
if ( slap_tool_destroy())
rc = EXIT_FAILURE;
return( rc );
}
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2004-2008 The OpenLDAP Foundation.
......@@ -108,7 +109,8 @@ slaptest( int argc, char **argv )
fprintf( stderr, "config file testing succeeded\n");
}
slap_tool_destroy();
if ( slap_tool_destroy())
rc = EXIT_FAILURE;
return rc;
}
Markdown is supported
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