From c4b1286fa9423129da4f089389a448aeeef16f8d Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 22 Oct 1998 00:40:49 +0000 Subject: [PATCH] SLAPD and tools compile and link! LTHREAD still needs work. --- configure | 25 +-- configure.in | 1 + include/ldbm.h | 111 +++++------ include/portable.h.in | 3 + libraries/libldap/abandon.c | 8 +- libraries/libldap/cldap.c | 23 +-- libraries/libldap/error.c | 4 +- libraries/libldap/kbind.c | 8 +- libraries/libldap/result.c | 16 +- libraries/libldap/search.c | 8 +- libraries/libldap/test.c | 46 ++--- libraries/libldap/tmplout.c | 68 ++++--- libraries/libldbm/ldbm.c | 255 ++++++++++++------------- servers/slapd/tools/centipede.c | 33 ++-- servers/slapd/tools/chlog2replog.c | 5 +- servers/slapd/tools/edb2ldif.c | 8 +- servers/slapd/tools/ldapsyntax.c | 6 +- servers/slapd/tools/ldbmcat.c | 13 +- servers/slapd/tools/ldbmtest.c | 33 ++-- servers/slapd/tools/ldif.c | 8 +- servers/slapd/tools/ldif2id2children.c | 7 +- servers/slapd/tools/ldif2id2entry.c | 7 +- servers/slapd/tools/ldif2ldbm.c | 8 +- 23 files changed, 353 insertions(+), 351 deletions(-) diff --git a/configure b/configure index 0ee9272d2c..fb40b92de9 100755 --- a/configure +++ b/configure @@ -5862,6 +5862,7 @@ for ac_func in \ lockf \ memcpy \ memmove \ + mkstemp \ mktime \ select \ setpwfile \ @@ -5881,12 +5882,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5885: checking for $ac_func" >&5 +echo "configure:5886: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5937,12 +5938,12 @@ done for ac_func in getopt strdup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5941: checking for $ac_func" >&5 +echo "configure:5942: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5995,13 +5996,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:5999: checking declaration of sys_errlist" >&5 +echo "configure:6000: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6011,7 +6012,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:6015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -6032,20 +6033,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:6036: checking existence of sys_errlist" >&5 +echo "configure:6037: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:6049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index e112c59a52..b93b64f0a1 100644 --- a/configure.in +++ b/configure.in @@ -740,6 +740,7 @@ AC_CHECK_FUNCS( \ lockf \ memcpy \ memmove \ + mkstemp \ mktime \ select \ setpwfile \ diff --git a/include/ldbm.h b/include/ldbm.h index e9788fcbbf..0f4c07c3ad 100644 --- a/include/ldbm.h +++ b/include/ldbm.h @@ -3,43 +3,11 @@ #ifndef _LDBM_H_ #define _LDBM_H_ -#ifdef LDBM_USE_GDBM - -/***************************************************************** - * * - * use gdbm if possible * - * * - *****************************************************************/ - -#include - -typedef datum Datum; - -typedef GDBM_FILE LDBM; - -extern gdbm_error gdbm_errno; - -/* for ldbm_open */ -#define LDBM_READER GDBM_READER -#define LDBM_WRITER GDBM_WRITER -#define LDBM_WRCREAT GDBM_WRCREAT -#define LDBM_NEWDB GDBM_NEWDB -#define LDBM_FAST GDBM_FAST - -#define LDBM_SUFFIX ".gdbm" - -/* for ldbm_insert */ -#define LDBM_INSERT GDBM_INSERT -#define LDBM_REPLACE GDBM_REPLACE -#define LDBM_SYNC 0x80000000 - -#else /* end of gdbm */ - -#ifdef LDBM_USE_DBHASH +#ifdef LDBM_USE_DBBTREE /***************************************************************** * * - * use berkeley db hash package * + * use berkeley db btree package * * * *****************************************************************/ @@ -47,26 +15,27 @@ extern gdbm_error gdbm_errno; #include #include -#ifdef LDBM_USE_DB2_COMPAT185 +#ifdef HAVE_DB185_H # include #else # include -# ifdef LDBM_USE_DB2 +# ifdef HAVE_BERKELEY_DB2 # define R_NOOVERWRITE DB_NOOVERWRITE # define DEFAULT_DB_PAGE_SIZE 1024 # endif #endif + typedef DBT Datum; #define dsize size #define dptr data typedef DB *LDBM; -#define DB_TYPE DB_HASH +#define DB_TYPE DB_BTREE /* for ldbm_open */ -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 # define LDBM_READER DB_RDONLY # define LDBM_WRITER 0x00000 /* hopefully */ # define LDBM_WRCREAT (DB_NOMMAP|DB_CREATE|DB_THREAD) @@ -76,25 +45,23 @@ typedef DB *LDBM; # define LDBM_WRITER O_RDWR # define LDBM_WRCREAT (O_RDWR|O_CREAT) # define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) -# define LDBM_FAST 0 #endif -#define LDBM_SUFFIX ".dbh" +# define LDBM_FAST 0 + +#define LDBM_SUFFIX ".dbb" +#define LDBM_ORDERED 1 /* for ldbm_insert */ #define LDBM_INSERT R_NOOVERWRITE #define LDBM_REPLACE 0 #define LDBM_SYNC 0x80000000 -extern int errno; - -#else /* end of db hash */ - -#ifdef LDBM_USE_DBBTREE +#elif defined( LDBM_USE_DBHASH ) /***************************************************************** * * - * use berkeley db btree package * + * use berkeley db hash package * * * *****************************************************************/ @@ -102,7 +69,7 @@ extern int errno; #include #include -#ifdef LDBM_USE_DB2_COMPAT185 +#ifdef HAVE_DB185_H # include #else # include @@ -112,14 +79,13 @@ extern int errno; # endif #endif - typedef DBT Datum; #define dsize size #define dptr data typedef DB *LDBM; -#define DB_TYPE DB_BTREE +#define DB_TYPE DB_HASH /* for ldbm_open */ #ifdef LDBM_USE_DB2 @@ -132,23 +98,48 @@ typedef DB *LDBM; # define LDBM_WRITER O_RDWR # define LDBM_WRCREAT (O_RDWR|O_CREAT) # define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) +# define LDBM_FAST 0 #endif -# define LDBM_FAST 0 - -#define LDBM_SUFFIX ".dbb" -#define LDBM_ORDERED 1 +#define LDBM_SUFFIX ".dbh" /* for ldbm_insert */ #define LDBM_INSERT R_NOOVERWRITE #define LDBM_REPLACE 0 #define LDBM_SYNC 0x80000000 -extern int errno; +#elif defined( HAVE_GDBM ) + +/***************************************************************** + * * + * use gdbm if possible * + * * + *****************************************************************/ + +#include + +typedef datum Datum; + +typedef GDBM_FILE LDBM; + +extern gdbm_error gdbm_errno; + +/* for ldbm_open */ +#define LDBM_READER GDBM_READER +#define LDBM_WRITER GDBM_WRITER +#define LDBM_WRCREAT GDBM_WRCREAT +#define LDBM_NEWDB GDBM_NEWDB +#define LDBM_FAST GDBM_FAST + +#define LDBM_SUFFIX ".gdbm" + +/* for ldbm_insert */ +#define LDBM_INSERT GDBM_INSERT +#define LDBM_REPLACE GDBM_REPLACE +#define LDBM_SYNC 0x80000000 -#else /* end of db btree */ -#ifdef LDBM_USE_NDBM +#elif defined( HAVE_NDBM ) /***************************************************************** * * @@ -157,6 +148,7 @@ extern int errno; *****************************************************************/ #include + #ifdef HAVE_FCNTL_H #include #endif @@ -179,10 +171,7 @@ typedef DBM *LDBM; #define LDBM_REPLACE DBM_REPLACE #define LDBM_SYNC 0 -#endif /* ndbm */ -#endif /* db hash */ -#endif /* db btree */ -#endif /* gdbm */ +#endif int ldbm_errno( LDBM ldbm ); LDBM ldbm_open( char *name, int rw, int mode, int dbcachesize ); @@ -194,7 +183,7 @@ Datum ldbm_fetch( LDBM ldbm, Datum key ); int ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ); int ldbm_delete( LDBM ldbm, Datum key ); -#if LDBM_USE_DB2 +#if HAVE_BERKELEY_DB2 void *ldbm_malloc( size_t size ); Datum ldbm_firstkey( LDBM ldbm, DBC **dbch ); Datum ldbm_nextkey( LDBM ldbm, Datum key, DBC *dbcp ); diff --git a/include/portable.h.in b/include/portable.h.in index 3b8fd80dac..6dd9df1537 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -248,6 +248,9 @@ is provided ``as is'' without express or implied warranty. /* Define if you have the memmove function. */ #undef HAVE_MEMMOVE +/* Define if you have the mkstemp function. */ +#undef HAVE_MKSTEMP + /* Define if you have the mktime function. */ #undef HAVE_MKTIME diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index e9d718c99d..533695f3b5 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -99,18 +99,18 @@ do_abandon( LDAP *ld, int origid, int msgid ) err = -1; ld->ld_errno = LDAP_NO_MEMORY; } else { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( ld->ld_sb.sb_naddr > 0 ) { err = ber_printf( ber, "{isti}", ++ld->ld_msgid, ld->ld_cldapdn, LDAP_REQ_ABANDON, msgid ); } else { -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ err = ber_printf( ber, "{iti}", ++ld->ld_msgid, LDAP_REQ_ABANDON, msgid ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( err == -1 ) { ld->ld_errno = LDAP_ENCODING_ERROR; diff --git a/libraries/libldap/cldap.c b/libraries/libldap/cldap.c index dc4794cb3d..7dc16eba74 100644 --- a/libraries/libldap/cldap.c +++ b/libraries/libldap/cldap.c @@ -7,7 +7,7 @@ #include "portable.h" -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990, 1994 Regents of the University of Michigan.\nAll rights reserved.\n"; @@ -40,17 +40,14 @@ struct cldap_retinfo { long cri_timeout; }; -#ifdef NEEDPROTOS -static int add_addr( LDAP *ld, struct sockaddr *sap ); -static int cldap_result( LDAP *ld, int msgid, LDAPMessage **res, - struct cldap_retinfo *crip, char *base ); -static int cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, - LDAPMessage **res, char *base ); -#else /* NEEDPROTOS */ -static int add_addr(); -static int cldap_result(); -static int cldap_parsemsg(); -#endif /* NEEDPROTOS */ +static int add_addr LDAP_P(( + LDAP *ld, struct sockaddr *sap )); +static int cldap_result LDAP_P(( + LDAP *ld, int msgid, LDAPMessage **res, + struct cldap_retinfo *crip, char *base )); +static int cldap_parsemsg LDAP_P(( + LDAP *ld, int msgid, BerElement *ber, + LDAPMessage **res, char *base )); /* * cldap_open - initialize and connect to an ldap server. A magic cookie to @@ -525,4 +522,4 @@ cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, *res = chain; return(( *res == NULLMSG ) ? rc : ldap_result2error( ld, *res, 0 )); } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index 80dcd809fa..26c8778047 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -80,7 +80,7 @@ ldap_err2string( int err ) return( "Unknown error" ); } -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI void ldap_perror( LDAP *ld, char *s ) { @@ -119,7 +119,7 @@ ldap_perror( LDAP *ld, char *s ) { } -#endif /* NO_USERINTERFACE */ +#endif /* !LDAP_LIBUI */ int diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index a9cd60b99a..9ef667be2f 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -255,10 +255,10 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 ); if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) { -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI fprintf( stderr, "krb_get_tf_realm failed (%s)\n", krb_err_txt[err] ); -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ ld->ld_errno = LDAP_INVALID_CREDENTIALS; return( NULL ); } @@ -271,9 +271,9 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) if ( (err = krb_mk_req( &ktxt, service, krbinstance, realm, 0 )) != KSUCCESS ) { -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI fprintf( stderr, "krb_mk_req failed (%s)\n", krb_err_txt[err] ); -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ ld->ld_errno = LDAP_INVALID_CREDENTIALS; return( NULL ); } diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 7dafad5e8b..15eddb924c 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -38,7 +38,7 @@ static void merge_error_info LDAP_P(( LDAP *ld, LDAPRequest *parentr, LDAPReques static int read1msg LDAP_P(( LDAP *ld, int msgid, int all, Sockbuf *sb, LDAPMessage **result )); #endif /* LDAP_REFERRALS */ -#if defined( CLDAP ) || !defined( LDAP_REFERRALS ) +#if defined( LDAP_CONNECTIONLESS ) || !defined( LDAP_REFERRALS ) static int ldap_select1 LDAP_P(( LDAP *ld, struct timeval *timeout )); #endif @@ -588,7 +588,7 @@ merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ) -#if defined( CLDAP ) || !defined( LDAP_REFERRALS ) +#if defined( LDAP_CONNECTIONLESS ) || !defined( LDAP_REFERRALS ) #if !defined( MACOS ) && !defined( DOS ) && !defined( _WIN32 ) static int ldap_select1( LDAP *ld, struct timeval *timeout ) @@ -597,11 +597,13 @@ ldap_select1( LDAP *ld, struct timeval *timeout ) static int tblsize; if ( tblsize == 0 ) { -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF tblsize = sysconf( _SC_OPEN_MAX ); -#else /* !USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE tblsize = getdtablesize(); -#endif /* !USE_SYSCONF */ +#else + tblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if ( tblsize > FD_SETSIZE ) { tblsize = FD_SETSIZE; @@ -782,7 +784,7 @@ ldap_mark_abandoned( LDAP *ld, int msgid ) } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int cldap_getmsg( LDAP *ld, struct timeval *timeout, BerElement *ber ) { @@ -808,4 +810,4 @@ cldap_getmsg( LDAP *ld, struct timeval *timeout, BerElement *ber ) return( tag ); } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index da6e7d3763..b74635d3a5 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -117,19 +117,19 @@ ldap_build_search_req( LDAP *ld, char *base, int scope, char *filter, base = ""; } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( ld->ld_sb.sb_naddr > 0 ) { err = ber_printf( ber, "{ist{seeiib", ++ld->ld_msgid, ld->ld_cldapdn, LDAP_REQ_SEARCH, base, scope, ld->ld_deref, ld->ld_sizelimit, ld->ld_timelimit, attrsonly ); } else { -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ err = ber_printf( ber, "{it{seeiib", ++ld->ld_msgid, LDAP_REQ_SEARCH, base, scope, ld->ld_deref, ld->ld_sizelimit, ld->ld_timelimit, attrsonly ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( err == -1 ) { ld->ld_errno = LDAP_ENCODING_ERROR; diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index 84f478da80..d81481de0f 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -1,8 +1,9 @@ #include #include #include -#ifdef MACOS #include + +#ifdef MACOS #ifdef THINK_C #include #include @@ -31,21 +32,20 @@ #include "lber.h" #include "ldap.h" +/* including the "internal" defs is legit and nec. since this test routine has + * a-priori knowledge of libldap internal workings. + * hodges@stanford.edu 5-Feb-96 + */ +#include "ldap-int.h" + #if !defined( PCNFS ) && !defined( WINSOCK ) && !defined( MACOS ) #define MOD_USE_BVALS #endif /* !PCNFS && !WINSOCK && !MACOS */ -#ifdef NEEDPROTOS -static void handle_result( LDAP *ld, LDAPMessage *lm ); -static void print_ldap_result( LDAP *ld, LDAPMessage *lm, char *s ); -static void print_search_entry( LDAP *ld, LDAPMessage *res ); -static void free_list( char **list ); -#else -static void handle_result(); -static void print_ldap_result(); -static void print_search_entry(); -static void free_list(); -#endif /* NEEDPROTOS */ +static void handle_result LDAP_P(( LDAP *ld, LDAPMessage *lm )); +static void print_ldap_result LDAP_P(( LDAP *ld, LDAPMessage *lm, char *s )); +static void print_search_entry LDAP_P(( LDAP *ld, LDAPMessage *res )); +static void free_list LDAP_P(( char **list )); #define NOCACHEERRMSG "don't compile with -DNO_CACHE if you desire local caching" @@ -281,7 +281,7 @@ main( #endif /* WINSOCK */ int argc, char **argv ) { - LDAP *ld; + LDAP *ld = NULL; int i, c, port, cldapflg, errflg, method, id, msgtype; char line[256], command1, command2, command3; char passwd[64], dn[256], rdn[64], attr[64], value[256]; @@ -316,11 +316,11 @@ main( while (( c = getopt( argc, argv, "uh:d:s:p:t:T:" )) != -1 ) { switch( c ) { case 'u': -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS cldapflg++; -#else /* CLDAP */ - printf( "Compile with -DCLDAP for UDP support\n" ); -#endif /* CLDAP */ +#else /* LDAP_CONNECTIONLESS */ + printf( "Compile with -DLDAP_CONNECTIONLESS for UDP support\n" ); +#endif /* LDAP_CONNECTIONLESS */ break; case 'd': @@ -377,9 +377,9 @@ main( host == NULL ? "(null)" : host, port ); if ( cldapflg ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS ld = cldap_open( host, port ); -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ } else { ld = ldap_open( host, port ); } @@ -567,10 +567,10 @@ main( break; case 'q': /* quit */ -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( cldapflg ) cldap_close( ld ); -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ #ifdef LDAP_REFERRALS if ( !cldapflg ) #else /* LDAP_REFERRALS */ @@ -636,7 +636,7 @@ main( attrsonly = atoi( line ); if ( cldapflg ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS getline( line, sizeof(line), stdin, "Requestor DN (for logging)? " ); if ( cldap_search_s( ld, dn, scope, filter, types, @@ -648,7 +648,7 @@ main( handle_result( ld, res ); res = NULLMSG; } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ } else { if (( id = ldap_search( ld, dn, scope, filter, types, attrsonly )) == -1 ) { diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index 330527b421..0c5613de94 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -8,6 +8,7 @@ #include #include #include + #ifdef MACOS #include "macos.h" #else /* MACOS */ @@ -29,41 +30,36 @@ #include "ldap.h" #include "disptmpl.h" -#ifdef NEEDPROTOS -static int do_entry2text( LDAP *ld, char *buf, char *base, LDAPMessage *entry, +#include "ldapconfig.h" + +static int do_entry2text LDAP_P(( + LDAP *ld, char *buf, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts, char *urlprefix ); -static int do_entry2text_search( LDAP *ld, char *dn, char *base, + unsigned long opts, char *urlprefix )); +static int do_entry2text_search LDAP_P(( + LDAP *ld, char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, - int rdncount, unsigned long opts, char *urlprefix ); -static int do_vals2text( LDAP *ld, char *buf, char **vals, char *label, + int rdncount, unsigned long opts, char *urlprefix )); +static int do_vals2text LDAP_P(( + LDAP *ld, char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, - void *writeparm, char *eol, int rdncount, char *urlprefix ); -static int max_label_len( struct ldap_disptmpl *tmpl ); -static int output_label( char *buf, char *label, int width, - writeptype writeproc, void *writeparm, char *eol, int html ); -static int output_dn( char *buf, char *dn, int width, int rdncount, - writeptype writeproc, void *writeparm, char *eol, char *urlprefix ); -static void strcat_escaped( char *s1, char *s2 ); -static char *time2text( char *ldtimestr, int dateonly ); -static long gtime( struct tm *tm ); -static int searchaction( LDAP *ld, char *buf, char *base, LDAPMessage *entry, + void *writeparm, char *eol, int rdncount, char *urlprefix )); +static int max_label_len LDAP_P(( struct ldap_disptmpl *tmpl )); +static int output_label LDAP_P(( + char *buf, char *label, int width, + writeptype writeproc, void *writeparm, char *eol, int html )); +static int output_dn LDAP_P(( + char *buf, char *dn, int width, int rdncount, + writeptype writeproc, void *writeparm, char *eol, char *urlprefix )); +static void strcat_escaped LDAP_P(( char *s1, char *s2 )); +static char *time2text LDAP_P(( char *ldtimestr, int dateonly )); +static long gtime LDAP_P(( struct tm *tm )); +static int searchaction LDAP_P(( + LDAP *ld, char *buf, char *base, LDAPMessage *entry, char *dn, struct ldap_tmplitem *tip, int labelwidth, int rdncount, - writeptype writeproc, void *writeparm, char *eol, char *urlprefix ); -#else /* NEEDPROTOS */ -static int do_entry2text(); -static int do_entry2text_search(); -static int do_vals2text(); -static int max_label_len(); -static int output_label(); -static int output_dn(); -static void strcat_escaped(); -static char *time2text(); -static long gtime(); -static int searchaction(); -#endif /* NEEDPROTOS */ + writeptype writeproc, void *writeparm, char *eol, char *urlprefix )); #define DEF_LABEL_WIDTH 15 #define SEARCH_TIMEOUT_SECS 120 @@ -475,12 +471,12 @@ do_entry2text_search( ocattrs[0] = OCATTRNAME; ocattrs[1] = NULL; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( LDAP_IS_CLDAP( ld )) err = cldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", ocattrs, 0, &ldmp, NULL ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", ocattrs, 0, &timeout, &ldmp ); @@ -509,12 +505,12 @@ do_entry2text_search( fetchattrs = ldap_tmplattrs( tmpl, NULL, 1, LDAP_SYN_OPT_DEFER ); } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( LDAP_IS_CLDAP( ld )) err = cldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", fetchattrs, 0, &ldmp, NULL ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", fetchattrs, 0, &timeout, &ldmp ); @@ -987,7 +983,7 @@ searchaction( LDAP *ld, char *buf, char *base, LDAPMessage *entry, char *dn, struct ldap_tmplitem *tip, int labelwidth, int rdncount, writeptype writeproc, void *writeparm, char *eol, char *urlprefix ) { - int err, lderr, i, count, html; + int err = 0, lderr, i, count, html; char **vals, **members; char *value, *filtpattern, *attr, *selectname; char *retattrs[2], filter[ 256 ]; @@ -1047,12 +1043,12 @@ searchaction( LDAP *ld, char *buf, char *base, LDAPMessage *entry, char *dn, timeout.tv_sec = SEARCH_TIMEOUT_SECS; timeout.tv_usec = 0; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( LDAP_IS_CLDAP( ld )) lderr = cldap_search_s( ld, base, LDAP_SCOPE_SUBTREE, filter, retattrs, 0, &ldmp, NULL ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ lderr = ldap_search_st( ld, base, LDAP_SCOPE_SUBTREE, filter, retattrs, 0, &timeout, &ldmp ); diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index 33bd1888a7..57db9b0677 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -6,121 +6,15 @@ * - DB_DBT_MALLOC ; 1998/03/22, /KSp */ -#ifdef LDAP_LDBM +#include "portable.h" -#include -#include "ldbm.h" - -#ifdef LDBM_USE_GDBM - -#include -#include - -/***************************************************************** - * * - * use gdbm * - * * - *****************************************************************/ - -LDBM -ldbm_open( char *name, int rw, int mode, int dbcachesize ) -{ - LDBM db; - struct stat st; - - if ( (db = gdbm_open( name, 0, rw | GDBM_FAST, mode, 0 )) == NULL ) { - return( NULL ); - } - if ( dbcachesize > 0 && stat( name, &st ) == 0 ) { - dbcachesize = (dbcachesize / st.st_blksize); - gdbm_setopt( db, GDBM_CACHESIZE, &dbcachesize, sizeof(int) ); - } - - return( db ); -} - -void -ldbm_close( LDBM ldbm ) -{ - gdbm_close( ldbm ); -} - -void -ldbm_sync( LDBM ldbm ) -{ - gdbm_sync( ldbm ); -} - -void -ldbm_datum_free( LDBM ldbm, Datum data ) -{ - free( data.dptr ); -} - -Datum -ldbm_datum_dup( LDBM ldbm, Datum data ) -{ - Datum dup; - - if ( data.dsize == 0 ) { - dup.dsize = 0; - dup.dptr = NULL; +#ifdef SLAPD_LDBM - return( dup ); - } - dup.dsize = data.dsize; - if ( dup.dptr = (char *) malloc( data.dsize ) ) - memcpy( dup.dptr, data.dptr, data.dsize ); - - return( dup ); -} - -Datum -ldbm_fetch( LDBM ldbm, Datum key ) -{ - return( gdbm_fetch( ldbm, key ) ); -} - -int -ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) -{ - int rc; - - rc = gdbm_store( ldbm, key, data, flags & ~LDBM_SYNC ); - if ( flags & LDBM_SYNC ) - gdbm_sync( ldbm ); - return( rc ); -} - -int -ldbm_delete( LDBM ldbm, Datum key ) -{ - int rc; - - rc = gdbm_delete( ldbm, key ); - gdbm_sync( ldbm ); - return( rc ); -} - -Datum -ldbm_firstkey( LDBM ldbm ) -{ - return( gdbm_firstkey( ldbm ) ); -} - -Datum -ldbm_nextkey( LDBM ldbm, Datum key ) -{ - return( gdbm_nextkey( ldbm, key ) ); -} +#include +#include -int -ldbm_errno( LDBM ldbm ) -{ - return( (int) gdbm_errno ); -} +#include "ldbm.h" -#else #if defined( LDBM_USE_DBHASH ) || defined( LDBM_USE_DBBTREE ) /***************************************************************** @@ -129,16 +23,13 @@ ldbm_errno( LDBM ldbm ) * * *****************************************************************/ -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 /************************************************* * * * A malloc routine for use with DB_DBT_MALLOC * * * *************************************************/ -#include - - void * ldbm_malloc( size_t size ) { @@ -153,7 +44,7 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) { LDBM ret = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DB_INFO dbinfo; memset( &dbinfo, 0, sizeof( dbinfo )); @@ -190,7 +81,7 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) void ldbm_close( LDBM ldbm ) { -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 (*ldbm->close)( ldbm, 0 ); #else (*ldbm->close)( ldbm ); @@ -214,7 +105,7 @@ ldbm_datum_dup( LDBM ldbm, Datum data ) { Datum dup; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &dup, 0, sizeof( dup )); #endif @@ -237,7 +128,7 @@ ldbm_fetch( LDBM ldbm, Datum key ) Datum data; int rc; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &data, 0, sizeof( data )); data.flags = DB_DBT_MALLOC; @@ -261,7 +152,7 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) { int rc; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 rc = (*ldbm->put)( ldbm, NULL, &key, &data, flags & ~LDBM_SYNC ); rc = (-1 ) * rc; #else @@ -277,7 +168,7 @@ ldbm_delete( LDBM ldbm, Datum key ) { int rc; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 rc = (*ldbm->del)( ldbm, NULL, &key, 0 ); rc = (-1 ) * rc; #else @@ -288,7 +179,7 @@ ldbm_delete( LDBM ldbm, Datum key ) } Datum -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 ldbm_firstkey( LDBM ldbm, DBC **dbch ) #else ldbm_firstkey( LDBM ldbm ) @@ -297,7 +188,7 @@ ldbm_firstkey( LDBM ldbm ) Datum key, data; int rc; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *dbci; memset( &key, 0, sizeof( key )); @@ -321,7 +212,7 @@ ldbm_firstkey( LDBM ldbm ) key.dsize = 0; } -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 } #endif @@ -329,7 +220,7 @@ ldbm_firstkey( LDBM ldbm ) } Datum -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 ldbm_nextkey( LDBM ldbm, Datum key, DBC *dbcp ) #else ldbm_nextkey( LDBM ldbm, Datum key ) @@ -338,7 +229,7 @@ ldbm_nextkey( LDBM ldbm, Datum key ) Datum data; int rc; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 void *oldKey = key.dptr; memset( &data, 0, sizeof( data )); @@ -355,7 +246,7 @@ ldbm_nextkey( LDBM ldbm, Datum key ) key.dptr = NULL; key.dsize = 0; } -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 if ( oldKey ) free( oldKey ); #endif @@ -368,9 +259,113 @@ ldbm_errno( LDBM ldbm ) return( errno ); } -#else +#elif defined( HAVE_GDBM ) + +/***************************************************************** + * * + * use gdbm * + * * + *****************************************************************/ + +LDBM +ldbm_open( char *name, int rw, int mode, int dbcachesize ) +{ + LDBM db; + struct stat st; + + if ( (db = gdbm_open( name, 0, rw | GDBM_FAST, mode, 0 )) == NULL ) { + return( NULL ); + } + if ( dbcachesize > 0 && stat( name, &st ) == 0 ) { + dbcachesize = (dbcachesize / st.st_blksize); + gdbm_setopt( db, GDBM_CACHESIZE, &dbcachesize, sizeof(int) ); + } + + return( db ); +} + +void +ldbm_close( LDBM ldbm ) +{ + gdbm_close( ldbm ); +} + +void +ldbm_sync( LDBM ldbm ) +{ + gdbm_sync( ldbm ); +} + +void +ldbm_datum_free( LDBM ldbm, Datum data ) +{ + free( data.dptr ); +} + +Datum +ldbm_datum_dup( LDBM ldbm, Datum data ) +{ + Datum dup; + + if ( data.dsize == 0 ) { + dup.dsize = 0; + dup.dptr = NULL; + + return( dup ); + } + dup.dsize = data.dsize; + if ( dup.dptr = (char *) malloc( data.dsize ) ) + memcpy( dup.dptr, data.dptr, data.dsize ); + + return( dup ); +} + +Datum +ldbm_fetch( LDBM ldbm, Datum key ) +{ + return( gdbm_fetch( ldbm, key ) ); +} + +int +ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ) +{ + int rc; + + rc = gdbm_store( ldbm, key, data, flags & ~LDBM_SYNC ); + if ( flags & LDBM_SYNC ) + gdbm_sync( ldbm ); + return( rc ); +} + +int +ldbm_delete( LDBM ldbm, Datum key ) +{ + int rc; + + rc = gdbm_delete( ldbm, key ); + gdbm_sync( ldbm ); + return( rc ); +} + +Datum +ldbm_firstkey( LDBM ldbm ) +{ + return( gdbm_firstkey( ldbm ) ); +} + +Datum +ldbm_nextkey( LDBM ldbm, Datum key ) +{ + return( gdbm_nextkey( ldbm, key ) ); +} + +int +ldbm_errno( LDBM ldbm ) +{ + return( (int) gdbm_errno ); +} -#ifdef LDBM_USE_NDBM +#elif defined( HAVE_NDBM ) /***************************************************************** * * @@ -459,6 +454,4 @@ ldbm_errno( LDBM ldbm ) } #endif /* ndbm */ -#endif /* db */ -#endif /* gdbm */ #endif /* ldbm */ diff --git a/servers/slapd/tools/centipede.c b/servers/slapd/tools/centipede.c index 5de9388b56..ce1203d2bb 100644 --- a/servers/slapd/tools/centipede.c +++ b/servers/slapd/tools/centipede.c @@ -3,11 +3,14 @@ #include "portable.h" #include -#include -#include -#include + +#include +#include +#include + #include #include + #include #include @@ -558,10 +561,10 @@ diff_centroids( int amax, acur, dmax, dcur; char **vals; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *ocursorp; DBC *ncursorp; -#endif /* LDBM_USE_DB2 */ +#endif /* HAVE_BERKELEY_DB2 */ if ( verbose ) { printf( "Generating mods for differential %s centroid...", attr ); @@ -607,7 +610,7 @@ diff_centroids( olast.dptr = NULL; nlast.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( okey = ldbm_firstkey( oldbm, &ocursorp ), nkey = ldbm_firstkey( nldbm, &ncursorp ); okey.dptr != NULL && nkey.dptr != NULL; ) @@ -629,7 +632,7 @@ diff_centroids( } nlast = nkey; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 okey = ldbm_nextkey( oldbm, olast, ocursorp ); nkey = ldbm_nextkey( nldbm, nlast, ncursorp ); #else @@ -648,7 +651,7 @@ diff_centroids( } nlast = nkey; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 nkey = ldbm_nextkey( nldbm, nlast, ncursorp ); #else nkey = ldbm_nextkey( nldbm, nlast ); @@ -665,7 +668,7 @@ diff_centroids( } olast = okey; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 okey = ldbm_nextkey( oldbm, olast, ocursorp ); #else okey = ldbm_nextkey( oldbm, olast ); @@ -679,7 +682,7 @@ diff_centroids( return( NULL ); } -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 okey = ldbm_nextkey( oldbm, olast, ocursorp ); #else okey = ldbm_nextkey( oldbm, olast ); @@ -698,7 +701,7 @@ diff_centroids( return( NULL ); } -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 nkey = ldbm_nextkey( nldbm, nlast, ncursorp ); #else nkey = ldbm_nextkey( nldbm, nlast ); @@ -723,7 +726,7 @@ diff_centroids( /* generate list of values to add */ lastkey.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( nldbm, &ncursorp ); key.dptr != NULL; key = ldbm_nextkey( nldbm, lastkey, ncursorp ) ) #else @@ -754,7 +757,7 @@ diff_centroids( /* generate list of values to delete */ lastkey.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( oldbm, &ocursorp ); key.dptr != NULL; key = ldbm_nextkey( oldbm, lastkey, ocursorp ) ) #else @@ -821,7 +824,7 @@ full_centroid( char **vals; int vcur, vmax; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *cursorp; #endif @@ -852,7 +855,7 @@ full_centroid( lastkey.dptr = NULL; vals = NULL; vcur = vmax = 0; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( ldbm, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( ldbm, lastkey, cursorp ) ) #else diff --git a/servers/slapd/tools/chlog2replog.c b/servers/slapd/tools/chlog2replog.c index cd982936c8..85a9433bab 100644 --- a/servers/slapd/tools/chlog2replog.c +++ b/servers/slapd/tools/chlog2replog.c @@ -19,9 +19,10 @@ #include "portable.h" #include -#include #include -#include + +#include +#include #include #include diff --git a/servers/slapd/tools/edb2ldif.c b/servers/slapd/tools/edb2ldif.c index 29bbf1f497..5e2b3d9a30 100644 --- a/servers/slapd/tools/edb2ldif.c +++ b/servers/slapd/tools/edb2ldif.c @@ -13,10 +13,12 @@ #include "portable.h" #include -#include -#include #include -#include + +#include +#include +#include + #include #include diff --git a/servers/slapd/tools/ldapsyntax.c b/servers/slapd/tools/ldapsyntax.c index 69703a33d0..421f4fcd00 100644 --- a/servers/slapd/tools/ldapsyntax.c +++ b/servers/slapd/tools/ldapsyntax.c @@ -13,8 +13,10 @@ #include "portable.h" #include -#include -#include + +#include +#include + #include #include #include diff --git a/servers/slapd/tools/ldbmcat.c b/servers/slapd/tools/ldbmcat.c index b89a54f489..59cd4d1179 100644 --- a/servers/slapd/tools/ldbmcat.c +++ b/servers/slapd/tools/ldbmcat.c @@ -1,10 +1,11 @@ #include "portable.h" #include -#include -#include -#include -#include + +#include +#include +#include + #include "ldbm.h" #include "../slap.h" @@ -26,7 +27,7 @@ main( argc, argv ) char *file, *s; int printid = 1; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *cursorp; #endif @@ -48,7 +49,7 @@ main( argc, argv ) last.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( dbp, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( dbp, last, cursorp ) ) #else diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index fd2f1a0059..5be56d64f6 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -1,17 +1,22 @@ #include "portable.h" #include -#include #include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include + #include -#include #include #include -#include + +#ifdef HAVE_FCNTL_H +#include +#endif #include "ldapconfig.h" #include "../slap.h" @@ -66,7 +71,7 @@ main( argc, argv ) int i; extern char *optarg; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *cursorp; #endif @@ -157,7 +162,7 @@ main( argc, argv ) } savekey.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( dbc->dbc_db, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( dbc->dbc_db, key, cursorp ) ) @@ -327,7 +332,7 @@ main( argc, argv ) last.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( dbp, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( dbp, last, cursorp ) ) @@ -520,10 +525,12 @@ edit_entry( c, data ) int fd, pid; char tmpname[20]; FILE *fp; +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; +#endif strcpy( tmpname, "/tmp/dbtestXXXXXX" ); -#ifdef ultrix +#ifndef HAVE_MKSTEMP if ( (fd = open( mktemp( tmpname ), O_RDWR, 0600 )) == -1 ) { perror( tmpname ); return; @@ -557,8 +564,8 @@ edit_entry( c, data ) fclose( fp ); -#ifdef USE_WAITPID - if ( waitpid( (pid_t) -1, 0, WAIT_FLAGS ) < 0 ) { +#ifdef HAVE_WAITPID + if ( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) < 0 ) { #else if ( wait3( &status, WAIT_FLAGS, 0 ) < 0 ) { #endif diff --git a/servers/slapd/tools/ldif.c b/servers/slapd/tools/ldif.c index adcb4b8534..6f68b77d72 100644 --- a/servers/slapd/tools/ldif.c +++ b/servers/slapd/tools/ldif.c @@ -1,10 +1,10 @@ #include "portable.h" #include -#include -#include -#include -#include + +#include +#include + #include "lber.h" #include "ldap.h" #include "ldif.h" diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 795a26f151..67be503f64 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -1,9 +1,10 @@ #include "portable.h" #include -#include -#include -#include + +#include +#include + #include "../slap.h" #include "../back-ldbm/back-ldbm.h" diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index 057b085307..de32fc9d53 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -1,9 +1,10 @@ #include "portable.h" #include -#include -#include -#include + +#include +#include + #include "../slap.h" #include "../back-ldbm/back-ldbm.h" diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index 01021b6840..d1da293c09 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -1,10 +1,12 @@ #include "portable.h" #include -#include -#include -#include + +#include +#include + #include + #include "../slap.h" #include "../back-ldbm/back-ldbm.h" #include "ldapconfig.h" -- 2.39.5