mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Use ldapconfig.h instead of hardcoded paths. Merged from -devel.
This commit is contained in:
parent
337540b41c
commit
c00311bc05
4 changed files with 51 additions and 94 deletions
|
|
@ -24,22 +24,22 @@ OBJS2 = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
|
||||||
../aclparse.o ../schema.o ../result.o ../filterentry.o \
|
../aclparse.o ../schema.o ../result.o ../filterentry.o \
|
||||||
../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
|
../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
|
||||||
../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
|
../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
|
||||||
../schemaparse.o ../regex.o ../strdup.o
|
../schemaparse.o ../strdup.o
|
||||||
|
|
||||||
INCLUDES= -I. -I$(HDIR) $(EXINCLUDES)
|
INCLUDES= -I. -I$(HDIR) $(EXINCLUDES)
|
||||||
DEFINES = $(DEFS) $(SERVERDEFS) $(THREADS)
|
DEFINES = $(DEFS) $(LDAP_CRYPT) $(SERVERDEFS) $(THREADS)
|
||||||
CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS)
|
CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS)
|
||||||
LDFLAGS = -L$(LDIR) $(EXLDFLAGS)
|
LDFLAGS = -L$(LDIR) $(EXLDFLAGS)
|
||||||
LIBS = -lldif -lldap -llber -lldbm -lavl $(LDBMLIB) $(EXLIBS) $(ALIBS)
|
LIBS = -lldif -lldap -llber -lldbm -llutil -lavl $(LDBMLIB) $(EXLIBS) $(ALIBS)
|
||||||
LIBS2 = -lldif -lldbm -lavl $(LDBMLIB) -llber $(KRBLIBFLAG) $(KRBLIBS) \
|
LIBS2 = -lldif -lldbm -llutil -lavl $(LDBMLIB) -llber $(KRBLIBFLAG) $(KRBLIBS) \
|
||||||
-llthread $(THREADSLIB) $(ALIBS)
|
-llthread $(THREADSLIB) $(ALIBS) $(LDAP_CRYPT_LIB)
|
||||||
|
|
||||||
all: build-edb2ldif ldif2index ldif2ldbm ldbmcat ldif2id2entry \
|
all: build-edb2ldif ldif2index ldif2ldbm ldbmcat ldif2id2entry \
|
||||||
ldif2id2children centipede ldbmtest ldif
|
ldif2id2children centipede ldbmtest ldif
|
||||||
|
|
||||||
build-edb2ldif: FORCE
|
build-edb2ldif: FORCE
|
||||||
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
||||||
$(MAKE) $(MFLAGS) CC=$(CC) EXINCLUDES="$(ISODEINCLUDEFLAG)" \
|
$(MAKE) $(MFLAGS) CC="$(CC)" EXINCLUDES="$(ISODEINCLUDEFLAG)" \
|
||||||
EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" edb2ldif; \
|
EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" edb2ldif; \
|
||||||
else \
|
else \
|
||||||
echo "uncomment the HAVEISODE=yes line in the Make-common file to build edb2ldif"; \
|
echo "uncomment the HAVEISODE=yes line in the Make-common file to build edb2ldif"; \
|
||||||
|
|
@ -59,7 +59,7 @@ edb2-vers.c: $(EDB2LDIFOBJS)
|
||||||
|
|
||||||
build-chlog2replog: FORCE
|
build-chlog2replog: FORCE
|
||||||
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
||||||
$(MAKE) $(MFLAGS) CC=$(CC) EXINCLUDES="$(ISODEINCLUDEFLAG)" \
|
$(MAKE) $(MFLAGS) CC="$(CC)" EXINCLUDES="$(ISODEINCLUDEFLAG)" \
|
||||||
EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" chlog2replog; \
|
EXLDFLAGS="$(ISODELIBFLAG)" EXLIBS="$(ISODELIBS)" chlog2replog; \
|
||||||
else \
|
else \
|
||||||
echo "uncomment the HAVEISODE=yes line in the Make-common file to build chlog2replog"; \
|
echo "uncomment the HAVEISODE=yes line in the Make-common file to build chlog2replog"; \
|
||||||
|
|
@ -73,13 +73,10 @@ ldif2index: ldif2index.o ../libbackends.a $(OBJS2)
|
||||||
$(CC) $(ALDFLAGS) -o $@ ldif2index.o $(OBJS2) \
|
$(CC) $(ALDFLAGS) -o $@ ldif2index.o $(OBJS2) \
|
||||||
../libbackends.a $(LDFLAGS) $(LIBS2)
|
../libbackends.a $(LDFLAGS) $(LIBS2)
|
||||||
|
|
||||||
ldif2ldbm: ldif2ldbm.sed.o ../libbackends.a $(OBJS2)
|
ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2)
|
||||||
$(CC) $(ALDFLAGS) -o $@ ldif2ldbm.sed.o $(OBJS2) \
|
$(CC) $(ALDFLAGS) -o $@ ldif2ldbm.o $(OBJS2) \
|
||||||
../libbackends.a $(LDFLAGS) $(LIBS2)
|
../libbackends.a $(LDFLAGS) $(LIBS2)
|
||||||
|
|
||||||
ldif2ldbm.sed.c: ldif2ldbm.c
|
|
||||||
$(SED) -e 's;%ETCDIR%;$(RUNTIMEETCDIR);' ldif2ldbm.c > ldif2ldbm.sed.c
|
|
||||||
|
|
||||||
ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2)
|
ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2)
|
||||||
$(CC) $(ALDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) \
|
$(CC) $(ALDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) \
|
||||||
../libbackends.a $(LDFLAGS) $(LIBS2)
|
../libbackends.a $(LDFLAGS) $(LIBS2)
|
||||||
|
|
@ -106,49 +103,49 @@ ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2)
|
||||||
$(CC) $(ALDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) \
|
$(CC) $(ALDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) \
|
||||||
../libbackends.a $(LDFLAGS) $(LIBS2)
|
../libbackends.a $(LDFLAGS) $(LIBS2)
|
||||||
|
|
||||||
install: $(ETCDIR) $(ETCDIR)/edb2ldif $(ETCDIR)/ldif2ldbm \
|
install: $(LDAP_SBINDIR) $(LDAP_SBINDIR)/edb2ldif $(LDAP_SBINDIR)/ldif2ldbm \
|
||||||
$(ETCDIR)/ldif2index $(ETCDIR)/ldif2id2entry \
|
$(LDAP_SBINDIR)/ldif2index $(LDAP_SBINDIR)/ldif2id2entry \
|
||||||
$(ETCDIR)/ldif2id2children $(ETCDIR)/ldbmcat \
|
$(LDAP_SBINDIR)/ldif2id2children $(LDAP_SBINDIR)/ldbmcat \
|
||||||
$(ETCDIR)/centipede $(ETCDIR)/ldbmtest \
|
$(LDAP_SBINDIR)/centipede $(LDAP_SBINDIR)/ldbmtest \
|
||||||
$(ETCDIR)/ldif
|
$(LDAP_SBINDIR)/ldif
|
||||||
|
|
||||||
$(ETCDIR)/edb2ldif: build-edb2ldif
|
$(LDAP_SBINDIR)/edb2ldif: build-edb2ldif
|
||||||
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(ETCDIR); \
|
$(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(LDAP_SBINDIR); \
|
||||||
else \
|
else \
|
||||||
exit 0; \
|
exit 0; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$(ETCDIR)/chlog2replog: build-chlog2replog
|
$(LDAP_SBINDIR)/chlog2replog: build-chlog2replog
|
||||||
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
@if [ "$(HAVEISODE)" = "yes" ]; then \
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(ETCDIR); \
|
$(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(LDAP_SBINDIR); \
|
||||||
else \
|
else \
|
||||||
exit 0; \
|
exit 0; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$(ETCDIR)/ldif2ldbm: ldif2ldbm
|
$(LDAP_SBINDIR)/ldif2ldbm: ldif2ldbm
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(LDAP_SBINDIR)
|
||||||
|
|
||||||
$(ETCDIR)/ldif2index: ldif2index
|
$(LDAP_SBINDIR)/ldif2index: ldif2index
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(LDAP_SBINDIR)
|
||||||
|
|
||||||
$(ETCDIR)/ldif2id2entry: ldif2id2entry
|
$(LDAP_SBINDIR)/ldif2id2entry: ldif2id2entry
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(LDAP_SBINDIR)
|
||||||
|
|
||||||
$(ETCDIR)/ldif2id2children: ldif2id2children
|
$(LDAP_SBINDIR)/ldif2id2children: ldif2id2children
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(LDAP_SBINDIR)
|
||||||
|
|
||||||
$(ETCDIR)/ldbmcat: ldbmcat
|
$(LDAP_SBINDIR)/ldbmcat: ldbmcat
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(LDAP_SBINDIR)
|
||||||
|
|
||||||
$(ETCDIR)/ldif: ldif
|
$(LDAP_SBINDIR)/ldif: ldif
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(LDAP_SBINDIR)
|
||||||
|
|
||||||
$(ETCDIR)/centipede: centipede
|
$(LDAP_SBINDIR)/centipede: centipede
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(LDAP_SBINDIR)
|
||||||
|
|
||||||
$(ETCDIR)/ldbmtest: ldbmtest
|
$(LDAP_SBINDIR)/ldbmtest: ldbmtest
|
||||||
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(ETCDIR)
|
$(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(LDAP_SBINDIR)
|
||||||
|
|
||||||
lint: FORCE
|
lint: FORCE
|
||||||
$(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
|
$(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
|
||||||
|
|
@ -160,60 +157,17 @@ clean: FORCE
|
||||||
@echo "making clean in `$(PWD)`"
|
@echo "making clean in `$(PWD)`"
|
||||||
$(RM) edb2ldif ldif2index *.o core a.out edb2-vers.c \
|
$(RM) edb2ldif ldif2index *.o core a.out edb2-vers.c \
|
||||||
ldif2ldbm ldif2id2entry ldif2id2children ldbmcat ldif \
|
ldif2ldbm ldif2id2entry ldif2id2children ldbmcat ldif \
|
||||||
centipede chlog2replog sizecount ldif2ldbm.sed.c ldbmtest
|
centipede chlog2replog sizecount ldbmtest
|
||||||
|
|
||||||
depend: ldif2ldbm.sed.c FORCE
|
depend: FORCE
|
||||||
@if [ ! -z "$(HAVEISODE)" ]; then \
|
@if [ ! -z "$(HAVEISODE)" ]; then \
|
||||||
DEPENDEXTRAS="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
|
DEPENDEXTRAS="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
|
||||||
fi; \
|
fi; \
|
||||||
$(MKDEP) $(INCLUDES) $(DEFINES) $$DEPENDEXTRAS ldif2index.c \
|
$(MKDEP) $(INCLUDES) $(DEFINES) $$DEPENDEXTRAS ldif2index.c \
|
||||||
ldif2ldbm.c ldif2id2entry.c ldif2id2children.c ldbmcat.c \
|
ldif2ldbm.c ldif2id2entry.c ldif2id2children.c ldbmcat.c \
|
||||||
centipede.c sizecount.c ldif2ldbm.sed.c ldbmtest.c ldif.c
|
centipede.c sizecount.c ldbmtest.c ldif.c
|
||||||
|
|
||||||
links:
|
links:
|
||||||
@echo "making links in `$(PWD)`"
|
@echo "making links in `$(PWD)`"
|
||||||
@$(LN) .src/*.[ch] .
|
@$(LN) .src/*.[ch] .
|
||||||
|
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- mkdep uses it.
|
|
||||||
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
|
|
||||||
|
|
||||||
chlog2replog.o: chlog2replog.c ../../../include/ldif.h
|
|
||||||
edb2ldif.o: edb2ldif.c
|
|
||||||
ldapsyntax.o: ldapsyntax.c ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldapsyntax.o: ../../../include/ldif.h ldapsyntax.h
|
|
||||||
ldif2index.o: ldif2index.c ../slap.h ../../../include/avl.h
|
|
||||||
ldif2index.o: ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldif2index.o: ../../../include/lthread.h ../../../include/ldif.h
|
|
||||||
ldif2ldbm.o: ldif2ldbm.c ../slap.h ../../../include/avl.h
|
|
||||||
ldif2ldbm.o: ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldif2ldbm.o: ../../../include/lthread.h ../../../include/ldif.h
|
|
||||||
ldif2ldbm.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h
|
|
||||||
ldif2id2entry.o: ldif2id2entry.c ../slap.h ../../../include/avl.h
|
|
||||||
ldif2id2entry.o: ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldif2id2entry.o: ../../../include/lthread.h ../../../include/ldif.h
|
|
||||||
ldif2id2entry.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h
|
|
||||||
ldif2id2children.o: ldif2id2children.c ../slap.h ../../../include/avl.h
|
|
||||||
ldif2id2children.o: ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldif2id2children.o: ../../../include/lthread.h ../../../include/ldif.h
|
|
||||||
ldif2id2children.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h
|
|
||||||
ldbmcat.o: ldbmcat.c ../../../include/ldbm.h ../slap.h ../../../include/avl.h
|
|
||||||
ldbmcat.o: ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldbmcat.o: ../../../include/lthread.h ../../../include/ldif.h
|
|
||||||
centipede.o: centipede.c ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
centipede.o: ../../../include/ldapconfig.h ../../../include/ldbm.h
|
|
||||||
sizecount.o: sizecount.c ../../../include/ldbm.h ../../../include/lber.h
|
|
||||||
sizecount.o: ../../../include/ldap.h ../../../include/portable.h
|
|
||||||
ldif2ldbm.sed.o: ldif2ldbm.sed.c ../slap.h ../../../include/avl.h
|
|
||||||
ldif2ldbm.sed.o: ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldif2ldbm.sed.o: ../../../include/lthread.h ../../../include/ldif.h
|
|
||||||
ldif2ldbm.sed.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h
|
|
||||||
ldbmtest.o: ldbmtest.c ../../../include/portable.h
|
|
||||||
ldbmtest.o: ../../../include/ldapconfig.h ../slap.h ../../../include/avl.h
|
|
||||||
ldbmtest.o: ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldbmtest.o: ../../../include/lthread.h ../../../include/ldif.h
|
|
||||||
ldbmtest.o: ../back-ldbm/back-ldbm.h ../../../include/ldbm.h
|
|
||||||
ldif.o: ldif.c ../../../include/lber.h ../../../include/ldap.h
|
|
||||||
ldif.o: ../../../include/ldif.h
|
|
||||||
|
|
||||||
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
#include "../slap.h"
|
#include "../slap.h"
|
||||||
#include "../back-ldbm/back-ldbm.h"
|
#include "../back-ldbm/back-ldbm.h"
|
||||||
|
|
||||||
#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf"
|
#include "ldapconfig.h"
|
||||||
|
|
||||||
#define MAXARGS 100
|
#define MAXARGS 100
|
||||||
|
|
||||||
extern struct dbcache *ldbm_cache_open();
|
extern struct dbcache *ldbm_cache_open();
|
||||||
|
|
@ -63,13 +64,13 @@ main( int argc, char **argv )
|
||||||
int dbnum;
|
int dbnum;
|
||||||
ID id;
|
ID id;
|
||||||
struct dbcache *db, *db2;
|
struct dbcache *db, *db2;
|
||||||
Backend *be;
|
Backend *be = NULL;
|
||||||
struct berval bv;
|
struct berval bv;
|
||||||
struct berval *vals[2];
|
struct berval *vals[2];
|
||||||
Avlnode *avltypes = NULL;
|
Avlnode *avltypes = NULL;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
|
|
||||||
tailorfile = DEFAULT_CONFIGFILE;
|
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
|
||||||
dbnum = -1;
|
dbnum = -1;
|
||||||
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
|
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
|
|
@ -121,7 +122,7 @@ main( int argc, char **argv )
|
||||||
fprintf( stderr, "No ldbm database found in config file\n" );
|
fprintf( stderr, "No ldbm database found in config file\n" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
} else if ( dbnum < 1 || dbnum > nbackends ) {
|
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
|
||||||
fprintf( stderr, "Database number selected via -n is out of range\n" );
|
fprintf( stderr, "Database number selected via -n is out of range\n" );
|
||||||
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
|
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
#include "../slap.h"
|
#include "../slap.h"
|
||||||
#include "../back-ldbm/back-ldbm.h"
|
#include "../back-ldbm/back-ldbm.h"
|
||||||
|
|
||||||
#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf"
|
#include "ldapconfig.h"
|
||||||
|
|
||||||
#define MAXARGS 100
|
#define MAXARGS 100
|
||||||
|
|
||||||
extern struct dbcache *ldbm_cache_open();
|
extern struct dbcache *ldbm_cache_open();
|
||||||
|
|
@ -65,7 +66,7 @@ main( int argc, char **argv )
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
|
|
||||||
tailorfile = DEFAULT_CONFIGFILE;
|
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
|
||||||
dbnum = -1;
|
dbnum = -1;
|
||||||
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
|
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
|
|
@ -117,7 +118,7 @@ main( int argc, char **argv )
|
||||||
fprintf( stderr, "No ldbm database found in config file\n" );
|
fprintf( stderr, "No ldbm database found in config file\n" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
} else if ( dbnum < 1 || dbnum > nbackends ) {
|
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
|
||||||
fprintf( stderr, "Database number selected via -n is out of range\n" );
|
fprintf( stderr, "Database number selected via -n is out of range\n" );
|
||||||
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
|
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include "../slap.h"
|
#include "../slap.h"
|
||||||
|
|
||||||
#define DEFAULT_CONFIGFILE "/usr/local/etc/slapd.conf"
|
#include "ldapconfig.h"
|
||||||
|
|
||||||
#define MAXARGS 100
|
#define MAXARGS 100
|
||||||
|
|
||||||
extern void attr_index_config();
|
extern void attr_index_config();
|
||||||
|
|
@ -53,13 +54,13 @@ main( int argc, char **argv )
|
||||||
int lmax, lcur, indexmask, syntaxmask;
|
int lmax, lcur, indexmask, syntaxmask;
|
||||||
int dbnum;
|
int dbnum;
|
||||||
unsigned long id;
|
unsigned long id;
|
||||||
Backend *be;
|
Backend *be = NULL;
|
||||||
struct berval bv;
|
struct berval bv;
|
||||||
struct berval *vals[2];
|
struct berval *vals[2];
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
|
|
||||||
inputfile = NULL;
|
inputfile = NULL;
|
||||||
tailorfile = DEFAULT_CONFIGFILE;
|
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
|
||||||
dbnum = -1;
|
dbnum = -1;
|
||||||
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
|
while ( (i = getopt( argc, argv, "d:f:i:n:" )) != EOF ) {
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
|
|
@ -108,7 +109,7 @@ main( int argc, char **argv )
|
||||||
fprintf( stderr, "No ldbm database found in config file\n" );
|
fprintf( stderr, "No ldbm database found in config file\n" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
}
|
}
|
||||||
} else if ( dbnum < 1 || dbnum > nbackends ) {
|
} else if ( dbnum < 0 || dbnum > (nbackends-1) ) {
|
||||||
fprintf( stderr, "Database number selected via -n is out of range\n" );
|
fprintf( stderr, "Database number selected via -n is out of range\n" );
|
||||||
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
|
fprintf( stderr, "Must be in the range 1 to %d (number of databases in the config file)\n", nbackends );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue