From: Hallvard Furuseth Date: Mon, 16 Aug 1999 07:09:28 +0000 (+0000) Subject: back-ldbm: Kill ldbm_ignore_nextid_file, replace with slapMode==SLAP_TOOL_MODE X-Git-Tag: TWEB_OL_BASE~207 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3b5b9e1e5f4e70b6ff0ecb5aa8da2f725713a58d;p=openldap back-ldbm: Kill ldbm_ignore_nextid_file, replace with slapMode==SLAP_TOOL_MODE --- diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index fac176726e..2b699eba9f 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -159,8 +159,6 @@ struct ldbminfo { #endif }; -extern int ldbm_ignore_nextid_file; - LDAP_END_DECL #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/config.c b/servers/slapd/back-ldbm/config.c index c0b62d8902..8df6e46fa1 100644 --- a/servers/slapd/back-ldbm/config.c +++ b/servers/slapd/back-ldbm/config.c @@ -14,8 +14,6 @@ #include "slap.h" #include "back-ldbm.h" -int ldbm_ignore_nextid_file = 0; - int ldbm_back_db_config( diff --git a/servers/slapd/back-ldbm/nextid.c b/servers/slapd/back-ldbm/nextid.c index 3e5b16ffbe..0e45fced41 100644 --- a/servers/slapd/back-ldbm/nextid.c +++ b/servers/slapd/back-ldbm/nextid.c @@ -17,13 +17,13 @@ #include "slap.h" #include "back-ldbm.h" -/* All functions except put_nextid() obey ldbm_ignore_nextid_file. */ +/* All functions except put_nextid() obey slapMode == SLAP_TOOL_MODE. */ static ID next_id_read( Backend *be ); static ID next_id_get_save( Backend *be, int do_save ); #define next_id_write( be, id ) \ - (ldbm_ignore_nextid_file ? (be, id, 0) : put_nextid( be, id )) + (slapMode == SLAP_TOOL_MODE ? (be, id, 0) : put_nextid( be, id )) static ID next_id_read( Backend *be ) @@ -34,7 +34,7 @@ next_id_read( Backend *be ) char* file = li->li_nextid_file; FILE* fp; - if ( ldbm_ignore_nextid_file ) + if ( slapMode == SLAP_TOOL_MODE ) return NOID; if ( (fp = fopen( file, "r" )) == NULL ) { diff --git a/servers/slapd/init.c b/servers/slapd/init.c index ea9234ddd0..f11af8f24a 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -83,14 +83,14 @@ slap_init( int mode, char *name ) case SLAP_SERVER_MODE: case SLAP_TOOL_MODE: -#ifdef SLAPD_BDB2 +#ifdef SLAP_TIMEDSERVER_MODE case SLAP_TIMEDSERVER_MODE: - case SLAP_TOOLID_MODE: #endif + case SLAP_TOOLID_MODE: Debug( LDAP_DEBUG_TRACE, "%s init: initiated %s.\n", - name, mode == SLAP_TOOL_MODE ? "tool" : "server", 0 ); + name, (mode == SLAP_TOOL_MODE || mode == SLAP_TOOLID_MODE) ? "tool" : "server", 0 ); slap_name = name; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 4792c0bb41..a9a21d1467 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -396,8 +396,8 @@ extern int slapMode; #define SLAP_TOOL_MODE 2 #ifdef SLAPD_BDB2 # define SLAP_TIMEDSERVER_MODE 3 -# define SLAP_TOOLID_MODE 4 #endif +#define SLAP_TOOLID_MODE 4 /* temporary aliases */ typedef BackendDB Backend; diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index cb60859c32..37d8190cf5 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -33,8 +33,6 @@ main( int argc, char **argv ) struct berval bv; struct berval *vals[2]; - ldbm_ignore_nextid_file = 1; - slap_ldif_init( argc, argv, LDIF2ID2CHILDREN, "ldbm", SLAP_TOOL_MODE ); slap_startup(dbnum); diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index ea7fde6d38..9d279bda3f 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -30,9 +30,7 @@ main( int argc, char **argv ) struct berval bv; struct berval *vals[2]; - ldbm_ignore_nextid_file = 1; - - slap_ldif_init( argc, argv, LDIF2ID2ENTRY, "ldbm", SLAP_TOOL_MODE ); + slap_ldif_init( argc, argv, LDIF2ID2ENTRY, "ldbm", SLAP_TOOLID_MODE ); slap_startup(dbnum); @@ -75,7 +73,7 @@ main( int argc, char **argv ) } maxid++; - put_nextid( be, maxid ); /* override ldbm_ignore_nextid_file */ + put_nextid( be, maxid ); #ifdef SLAP_CLEANUP ldbm_cache_close( be, db ); diff --git a/servers/slapd/tools/ldif2index.c b/servers/slapd/tools/ldif2index.c index d69cf8a1ba..d6a38ed582 100644 --- a/servers/slapd/tools/ldif2index.c +++ b/servers/slapd/tools/ldif2index.c @@ -30,8 +30,6 @@ main( int argc, char **argv ) struct berval bv; struct berval *vals[2]; - ldbm_ignore_nextid_file = 1; - slap_ldif_init( argc, argv, LDIF2INDEX, "ldbm", SLAP_TOOL_MODE ); attr = attr_normalize( argv[argc - 1] ); diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index f54eb8c6db..cc8984021f 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -50,8 +50,6 @@ main( int argc, char **argv ) struct berval *vals[2]; Avlnode *avltypes = NULL; - ldbm_ignore_nextid_file = 1; - slap_ldif_init( argc, argv, LDIF2LDBM, "ldbm", SLAP_TOOL_MODE ); slap_startup(dbnum);