From ca7dba5182ff8fed583078d54623fc8689516d54 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 30 Apr 1999 05:24:16 +0000 Subject: [PATCH] ITS#141: Add ldbm_ignore_nextid_file, since tools/ldif2* handles it privately --- servers/slapd/back-ldbm/back-ldbm.h | 2 ++ servers/slapd/back-ldbm/config.c | 3 +++ servers/slapd/back-ldbm/nextid.c | 6 ++++++ servers/slapd/tools/ldif2id2children.c | 2 ++ servers/slapd/tools/ldif2id2entry.c | 2 ++ servers/slapd/tools/ldif2index.c | 2 ++ servers/slapd/tools/ldif2ldbm.c | 2 ++ 7 files changed, 19 insertions(+) diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index 0f6623ce57..73fc4eb902 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -142,6 +142,8 @@ struct ldbminfo { #endif }; +extern int ldbm_ignore_nextid_file; + #include "proto-back-ldbm.h" LDAP_END_DECL diff --git a/servers/slapd/back-ldbm/config.c b/servers/slapd/back-ldbm/config.c index af385a1488..e31ef72422 100644 --- a/servers/slapd/back-ldbm/config.c +++ b/servers/slapd/back-ldbm/config.c @@ -10,6 +10,9 @@ #include "slap.h" #include "back-ldbm.h" +int ldbm_ignore_nextid_file = 0; + + int ldbm_back_db_config( Backend *be, diff --git a/servers/slapd/back-ldbm/nextid.c b/servers/slapd/back-ldbm/nextid.c index 031e0a1d36..34c7bfe5c9 100644 --- a/servers/slapd/back-ldbm/nextid.c +++ b/servers/slapd/back-ldbm/nextid.c @@ -27,6 +27,9 @@ next_id_read( Backend *be ) char* file = li->li_nextid_file; FILE* fp; + if ( ldbm_ignore_nextid_file ) + return NOID; + if ( (fp = fopen( file, "r" )) == NULL ) { Debug( LDAP_DEBUG_ANY, "next_id_read: could not open \"%s\"\n", @@ -63,6 +66,9 @@ next_id_write( Backend *be, ID id ) FILE* fp; int rc; + if ( ldbm_ignore_nextid_file ) + return 0; + if ( (fp = fopen( file, "w" )) == NULL ) { Debug( LDAP_DEBUG_ANY, "next_id_write(%ld): could not open \"%s\"\n", id, file, 0 ); diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 6c36ee546e..8564b86777 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -42,6 +42,8 @@ main( int argc, char **argv ) struct berval bv; struct berval *vals[2]; + ldbm_ignore_nextid_file = 1; + tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) { diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index 6f80b282e0..9ed951bc47 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -40,6 +40,8 @@ main( int argc, char **argv ) struct berval *vals[2]; FILE *fp; + ldbm_ignore_nextid_file = 1; + tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) { diff --git a/servers/slapd/tools/ldif2index.c b/servers/slapd/tools/ldif2index.c index d7efa59f76..60688763be 100644 --- a/servers/slapd/tools/ldif2index.c +++ b/servers/slapd/tools/ldif2index.c @@ -39,6 +39,8 @@ main( int argc, char **argv ) struct berval bv; struct berval *vals[2]; + ldbm_ignore_nextid_file = 1; + inputfile = NULL; tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index 5426c606b3..ec0ca9c506 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -65,6 +65,8 @@ main( int argc, char **argv ) struct berval *vals[2]; Avlnode *avltypes = NULL; + ldbm_ignore_nextid_file = 1; + sbindir = DEFAULT_SBINDIR; tailorfile = SLAPD_DEFAULT_CONFIGFILE; dbnum = -1; -- 2.39.5