static void edit_entry(char c, Datum *data);
static void get_keydata(FILE *fp, char c, Datum *key, Datum *data);
-struct dbcache *dbc;
-LDBM dbp;
-char *tailorfile;
-Backend *be = NULL;
-int ldap_debug;
-int ldap_syslog;
-int ldap_syslog_level;
-long num_entries_sent;
-long num_bytes_sent;
-int active_threads;
-char *default_referral;
-time_t currenttime;
-pthread_t listener_tid;
-pthread_mutex_t num_sent_mutex;
-pthread_mutex_t entry2str_mutex;
-pthread_mutex_t active_threads_mutex;
-pthread_mutex_t new_conn_mutex;
-pthread_mutex_t currenttime_mutex;
-pthread_mutex_t replog_mutex;
-pthread_mutex_t ops_mutex;
-pthread_mutex_t regex_mutex;
+static struct dbcache *dbc;
+static LDBM dbp;
+static Backend *be = NULL;
int
main( int argc, char **argv )
IDList *idl;
Backend *tbe;
int i;
+ char *tailorfile;
#ifdef HAVE_BERKELEY_DB2
DBC *cursorp;
-
- memset( &savekey, 0, sizeof( savekey ));
- memset( &key, 0, sizeof( key ));
- memset( &data, 0, sizeof( data ));
- memset( &last, 0, sizeof( last ));
#endif
+ ldbm_datum_init( savekey );
+ ldbm_datum_init( key );
+ ldbm_datum_init( data );
+ ldbm_datum_init( last );
+
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
while ( (i = getopt( argc, argv, "d:f:" )) != EOF ) {
switch ( i ) {
"key: ", NULL, NULL );
}
- ldbm_datum_free( dbc->dbc_db, data );
+ if ( data.dptr != NULL ) {
+ ldbm_datum_free( dbc->dbc_db, data );
+ }
}
if ( savekey.dptr != NULL )
ldbm_datum_free( dbc->dbc_db, savekey );
perror( tmpname );
return;
}
- ldbm_datum_free( NULL, *data );
+ if ( data->dptr != NULL ) {
+ ldbm_datum_free( NULL, *data );
+ }
get_keydata( fp, c, NULL, data );
fclose( fp );
unlink( tmpname );