From c09a2c63e7e34af648787dbcc4efbe9fcd5646ae Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Thu, 2 Sep 1999 08:05:17 +0000 Subject: [PATCH] Cleanup: Fix printf formats, remove unused variables, add missing prototypes in slapd, add static/const, add some return types or change to void return type. --- clients/tools/ldapdelete.c | 1 - clients/tools/ldapmodrdn.c | 1 - clients/tools/ldappasswd.c | 24 ++++++++++++------------ clients/tools/ldapsearch.c | 7 ++++--- libraries/liblber/sockbuf.c | 4 ++-- libraries/libldap/cache.c | 12 ++++++------ libraries/libldap/getdxbyname.c | 2 +- libraries/libldap/os-ip.c | 4 ++-- libraries/libldap/result.c | 12 ++++++------ libraries/libldap/schema.c | 3 --- servers/slapd/acl.c | 18 +++++++++--------- servers/slapd/back-ldap/back-ldap.h | 3 +++ servers/slapd/back-ldap/bind.c | 2 ++ servers/slapd/back-ldap/search.c | 4 ++++ servers/slapd/back-ldbm/dn2id.c | 1 - servers/slapd/back-ldbm/nextid.c | 1 - servers/slapd/back-ldbm/search.c | 1 - servers/slapd/back-shell/add.c | 2 +- servers/slapd/back-shell/bind.c | 2 +- servers/slapd/back-shell/compare.c | 2 +- servers/slapd/back-shell/delete.c | 2 +- servers/slapd/back-shell/modify.c | 2 +- servers/slapd/back-shell/modrdn.c | 2 +- servers/slapd/back-shell/search.c | 6 ++---- servers/slapd/back-shell/unbind.c | 2 +- servers/slapd/daemon.c | 7 +++---- servers/slapd/proto-slap.h | 3 +++ servers/slapd/tools/centipede.c | 11 +++++++---- servers/slapd/tools/sizecount.c | 4 ---- 29 files changed, 73 insertions(+), 72 deletions(-) diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 319a2de41f..694d7f8b61 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -20,7 +20,6 @@ static char *binddn = NULL; static char *passwd = NULL; -static char *base = NULL; static char *ldaphost = NULL; static int ldapport = 0; static int not, verbose, contoper; diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index 51b9719724..9e4556964c 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -32,7 +32,6 @@ static char *binddn = NULL; static char *passwd = NULL; -static char *base = NULL; static char *ldaphost = NULL; static int ldapport = 0; static int not, verbose, contoper; diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index 6ced63a274..f463b0379b 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -68,7 +68,7 @@ Salt; typedef struct hash_t { - char *name; + const char *name; unsigned int namesz; char *(*func) (const char *, Salt *); unsigned char takes_salt; @@ -89,7 +89,7 @@ static int auto_gen_pw = 0; * pw_encode() essentially base64 encodes a password and its salt */ -char * +static char * pw_encode (unsigned char *passwd, Salt * salt, unsigned int len) { int salted = salt && salt->salt && salt->len; @@ -123,7 +123,7 @@ pw_encode (unsigned char *passwd, Salt * salt, unsigned int len) * if you'd like to write a better salt generator, please, be my guest. */ -void +static void make_salt (Salt * salt, unsigned int len) { @@ -141,7 +141,7 @@ make_salt (Salt * salt, unsigned int len) * password generator */ -char * +static char * gen_pass (unsigned int len) { static const unsigned char autogen[] = @@ -160,7 +160,7 @@ gen_pass (unsigned int len) } #ifdef SLAPD_CLEARTEXT -char * +static char * hash_none (const char *pw_in, Salt * salt) { return (strdup (pw_in)); @@ -168,7 +168,7 @@ hash_none (const char *pw_in, Salt * salt) #endif #ifdef SLAPD_CRYPT -char * +static char * hash_crypt (const char *pw_in, Salt * salt) { static const unsigned char crypt64[] = @@ -198,7 +198,7 @@ hash_crypt (const char *pw_in, Salt * salt) } #endif -char * +static char * hash_md5 (const char *pw_in, Salt * salt) { lutil_MD5_CTX MD5context; @@ -214,7 +214,7 @@ hash_md5 (const char *pw_in, Salt * salt) return (pw_encode (MD5digest, salt, sizeof (MD5digest))); } -char * +static char * hash_sha1 (const char *pw_in, Salt * salt) { lutil_SHA1_CTX SHA1context; @@ -230,7 +230,7 @@ hash_sha1 (const char *pw_in, Salt * salt) return (pw_encode (SHA1digest, salt, sizeof (SHA1digest))); } -static Hash hashes[] = +static const Hash hashes[] = { #ifdef SLAPD_CLEARTEXT {"none", 4, hash_none, 0, HASHTYPE_NONE, HASHTYPE_NONE, 0}, @@ -245,7 +245,7 @@ static Hash hashes[] = {NULL, 0, NULL, 0, HASHTYPE_NONE, HASHTYPE_NONE, 0} }; -int +static int modify_dn (LDAP * ld, char *targetdn, char *pwattr, char *oldpw, char *newpw, HashTypes htype, Salt * salt) { @@ -325,8 +325,8 @@ modify_dn (LDAP * ld, char *targetdn, char *pwattr, char *oldpw, return (ret); } -void -usage (char *s) +static void +usage(const char *s) { fprintf (stderr, "Usage: %s [options] [filter]\n", s); fprintf (stderr, " -a attrib\tpassword attribute (default: " LDAP_PASSWD_ATTRIB ")\n"); diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index d5d09d1848..51e8639270 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -21,7 +21,7 @@ #define DEFSEP "=" static void -usage( char *s ) +usage( const char *s ) { fprintf( stderr, "usage: %s [options] filter [attributes...]\nwhere:\n" @@ -561,7 +561,8 @@ static int dosearch( } -void print_entry( +static void +print_entry( LDAP *ld, LDAPMessage *entry, int attrsonly) @@ -679,7 +680,7 @@ void print_entry( } -int +static int write_ldif( int type, char *name, char *value, ber_len_t vallen ) { char *ldif; diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c index 52b3204081..c68c1d8900 100644 --- a/libraries/liblber/sockbuf.c +++ b/libraries/liblber/sockbuf.c @@ -1026,8 +1026,8 @@ dgram_read( Sockbuf *sb, void *buf, ber_len_t len ) if ( sb->sb_debug ) { ber_log_printf( LDAP_DEBUG_ANY, sb->sb_debug, - "dgram_read udp_read %d bytes\n", - rc ); + "dgram_read udp_read %ld bytes\n", + (long) rc ); if ( rc > 0 ) ber_log_bprint( LDAP_DEBUG_PACKETS, sb->sb_debug, buf, rc ); diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index 020a1b81f4..43feaadbd4 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -261,8 +261,8 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) LDAPMessage *m, **mp, *req, *new, *prev; int err, keep; - Debug( LDAP_DEBUG_TRACE, "ldap_add_result_to_cache: id %d, type %d\n", - result->lm_msgid, result->lm_msgtype, 0 ); + Debug( LDAP_DEBUG_TRACE, "ldap_add_result_to_cache: id %ld, type %ld\n", + (long) result->lm_msgid, (long) result->lm_msgtype, 0 ); if ( ld->ld_cache == NULL || ( ld->ld_cache->lc_enabled == 0 )) { @@ -394,8 +394,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) prev = NULL; hash = cache_hash( &reqber ); for ( m = ld->ld_cache->lc_buckets[ hash ]; m != NULL; m = next ) { - Debug( LDAP_DEBUG_TRACE,"cc: examining id %d,type %d\n", - m->lm_msgid, m->lm_msgtype, 0 ); + Debug( LDAP_DEBUG_TRACE,"cc: examining id %ld,type %ld\n", + (long) m->lm_msgid, (long) m->lm_msgtype, 0 ); if ( difftime(c_time, m->lm_time) > ld->ld_cache->lc_timeout ) { /* delete expired message */ next = m->lm_next; @@ -441,8 +441,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request ) prev->lm_chain = new; } prev = new; - Debug( LDAP_DEBUG_TRACE, "cc: added type %d\n", - new->lm_msgtype, 0, 0 ); + Debug( LDAP_DEBUG_TRACE, "cc: added type %ld\n", + (long) new->lm_msgtype, 0, 0 ); } Debug( LDAP_DEBUG_TRACE, "cc: result returned from cache\n", 0, 0, 0 ); diff --git a/libraries/libldap/getdxbyname.c b/libraries/libldap/getdxbyname.c index 4543e88e45..1ceffd4c68 100644 --- a/libraries/libldap/getdxbyname.c +++ b/libraries/libldap/getdxbyname.c @@ -123,7 +123,7 @@ decode_answer( unsigned char *answer, ber_len_t len ) rr_len = _getshort( p ); p += INT16SZ; if ( class == C_IN && type == T_TXT ) { - int i, n, pref, txt_len; + int pref, txt_len; char *q, *r; q = (char *)p; diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 42460cccec..71fac706f1 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -187,8 +187,8 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t s, struct sockaddr_in *sin, int async) tv.tv_sec = opt_tv->tv_sec; } - osip_debug(ld, "ldap_connect_timeout: fd: %d tm: %d async: %d\n", - s, opt_tv ? tv.tv_sec : -1, async); + osip_debug(ld, "ldap_connect_timeout: fd: %d tm: %ld async: %d\n", + s, opt_tv ? tv.tv_sec : -1L, async); if ( ldap_pvt_ndelay_on(ld, s) == -1 ) return ( -1 ); diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index e517a059ab..a004f51440 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -340,7 +340,7 @@ try_read1msg( if (( lr = ldap_find_request_by_msgid( ld, id )) == NULL ) { Debug( LDAP_DEBUG_ANY, "no request for response with msgid %ld (tossing)\n", - id, 0, 0 ); + (long) id, 0, 0 ); ber_free( ber, 1 ); return( -2 ); /* continue looking */ } @@ -352,10 +352,10 @@ try_read1msg( return( -1 ); } - Debug( LDAP_DEBUG_TRACE, "ldap_read: %s msgid %ld, original id %d\n", + Debug( LDAP_DEBUG_TRACE, "ldap_read: %s msgid %ld, original id %ld\n", ( tag == LDAP_RES_SEARCH_ENTRY ) ? "entry" : ( tag == LDAP_RES_SEARCH_REFERENCE ) ? "reference" : "result", - id, lr->lr_origid ); + (long) id, (long) lr->lr_origid ); id = lr->lr_origid; refer_cnt = 0; @@ -428,7 +428,7 @@ Debug( LDAP_DEBUG_TRACE, id = lr->lr_msgid; tag = lr->lr_res_msgtype; Debug( LDAP_DEBUG_ANY, "request %ld done\n", - id, 0, 0 ); + (long) id, 0, 0 ); Debug( LDAP_DEBUG_TRACE, "res_errno: %d, res_error: <%s>, res_matched: <%s>\n", lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "", @@ -510,8 +510,8 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); return( -2 ); /* continue looking */ } - Debug( LDAP_DEBUG_TRACE, "adding response id %d type %d:\n", - new->lm_msgid, new->lm_msgtype, 0 ); + Debug( LDAP_DEBUG_TRACE, "adding response id %ld type %ld:\n", + (long) new->lm_msgid, (long) new->lm_msgtype, 0 ); /* part of a search response - add to end of list of entries */ for ( tmp = l; tmp->lm_chain != NULL && diff --git a/libraries/libldap/schema.c b/libraries/libldap/schema.c index 33f8f2674a..ffbe2bd256 100644 --- a/libraries/libldap/schema.c +++ b/libraries/libldap/schema.c @@ -1260,9 +1260,6 @@ ldap_str2attributetype( const char * s, int * code, const char ** errp ) int seen_substr = 0; int seen_syntax = 0; int seen_usage = 0; - int seen_kind = 0; - int seen_must = 0; - int seen_may = 0; LDAP_ATTRIBUTE_TYPE * at; char ** ssdummy; const char * savepos; diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index c49cc9cf05..385f6a15a6 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -517,7 +517,7 @@ acl_check_modlist( } #ifdef SLAPD_ACI_ENABLED -char * +static char * aci_bvstrdup (struct berval *bv) { char *s; @@ -530,7 +530,7 @@ aci_bvstrdup (struct berval *bv) return(s); } -int +static int aci_strbvcmp (char *s, struct berval *bv) { int res, len; @@ -546,7 +546,7 @@ aci_strbvcmp (char *s, struct berval *bv) return(0); } -int +static int aci_get_part (struct berval *list, int ix, char sep, struct berval *bv) { int len; @@ -581,7 +581,7 @@ aci_get_part (struct berval *list, int ix, char sep, struct berval *bv) return(bv->bv_len); } -int +static int aci_list_has_right (struct berval *list, int access, int action) { struct berval bv; @@ -640,7 +640,7 @@ aci_list_has_right (struct berval *list, int access, int action) #endif } -int +static int aci_list_has_attr (struct berval *list, char *attr) { struct berval bv; @@ -654,10 +654,10 @@ aci_list_has_attr (struct berval *list, char *attr) return(0); } -int +static int aci_list_has_attr_right (struct berval *list, char *attr, int access, int action) { - struct berval bv, entry; + struct berval bv; int i, found; /* loop through each rights/attr pair, skip first part (action) */ @@ -674,7 +674,7 @@ aci_list_has_attr_right (struct berval *list, char *attr, int access, int action return(found); } -int +static int aci_list_has_permission (struct berval *list, char *attr, int access) { struct berval perm, actn; @@ -707,7 +707,7 @@ aci_list_has_permission (struct berval *list, char *attr, int access) return(0); } -int +static int aci_group_member ( struct berval *subj, char *grpoc, diff --git a/servers/slapd/back-ldap/back-ldap.h b/servers/slapd/back-ldap/back-ldap.h index 99fb67e88d..341070cb6c 100644 --- a/servers/slapd/back-ldap/back-ldap.h +++ b/servers/slapd/back-ldap/back-ldap.h @@ -48,6 +48,9 @@ struct ldapinfo { struct ldapconn *ldap_back_getconn(struct ldapinfo *li, struct slap_conn *conn, struct slap_op *op); +void ldap_back_dobind(struct ldapconn *lc, Operation *op); +int ldap_back_op_result(struct ldapconn *lc, Operation *op); +int back_ldap_LTX_init_module(int argc, char *argv[]); LDAP_END_DECL diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index d57364a637..ad68aa7664 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -91,6 +91,7 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) return( lc ); } +void ldap_back_dobind(struct ldapconn *lc, Operation *op) { if (lc->bound) @@ -103,6 +104,7 @@ ldap_back_dobind(struct ldapconn *lc, Operation *op) lc->bound = 1; } +int ldap_back_op_result(struct ldapconn *lc, Operation *op) { int err; diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 05c6f2597b..eaeae0e7d0 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -32,6 +32,9 @@ #include "slap.h" #include "back-ldap.h" +static void ldap_send_entry( Backend *be, Operation *op, struct ldapconn *lc, + LDAPMessage *e, char **attrs, int attrsonly ); + int ldap_back_search( Backend *be, @@ -125,6 +128,7 @@ fail: return( ldap_back_op_result(lc, op) ); return( 0 ); } +static void ldap_send_entry( Backend *be, Operation *op, diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index f9b6154368..39ba6d4ee0 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -278,7 +278,6 @@ dn2entry_rw( int rw ) { - struct ldbminfo *li = (struct ldbminfo *) be->be_private; ID id; Entry *e = NULL; char *pdn; diff --git a/servers/slapd/back-ldbm/nextid.c b/servers/slapd/back-ldbm/nextid.c index 7287b3c5ab..0096190894 100644 --- a/servers/slapd/back-ldbm/nextid.c +++ b/servers/slapd/back-ldbm/nextid.c @@ -21,7 +21,6 @@ static ID next_id_read( Backend *be ) { - struct ldbminfo *li = (struct ldbminfo *) be->be_private; ID id = NOID; Datum key, data; DBCache *db; diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 720e73ab28..26c3c9619f 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -353,7 +353,6 @@ search_candidates( int manageDSAit ) { - struct ldbminfo *li = (struct ldbminfo *) be->be_private; ID_BLOCK *candidates; Filter *f, *rf, *af, *lf; diff --git a/servers/slapd/back-shell/add.c b/servers/slapd/back-shell/add.c index 1c189a96d4..1b6693f16a 100644 --- a/servers/slapd/back-shell/add.c +++ b/servers/slapd/back-shell/add.c @@ -36,7 +36,7 @@ shell_back_add( /* write out the request to the add process */ fprintf( wfp, "ADD\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); ldap_pvt_thread_mutex_lock( &entry2str_mutex ); fprintf( wfp, "%s", entry2str( e, &len ) ); diff --git a/servers/slapd/back-shell/bind.c b/servers/slapd/back-shell/bind.c index 1b61eeb778..4454ffdd82 100644 --- a/servers/slapd/back-shell/bind.c +++ b/servers/slapd/back-shell/bind.c @@ -43,7 +43,7 @@ shell_back_bind( /* write out the request to the bind process */ fprintf( wfp, "BIND\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); fprintf( wfp, "dn: %s\n", dn ); fprintf( wfp, "method: %d\n", method ); diff --git a/servers/slapd/back-shell/compare.c b/servers/slapd/back-shell/compare.c index c59ac34289..1788f21c1a 100644 --- a/servers/slapd/back-shell/compare.c +++ b/servers/slapd/back-shell/compare.c @@ -37,7 +37,7 @@ shell_back_compare( /* write out the request to the compare process */ fprintf( wfp, "COMPARE\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); fprintf( wfp, "dn: %s\n", dn ); fprintf( wfp, "%s: %s\n", ava->ava_type, ava->ava_value.bv_val ); diff --git a/servers/slapd/back-shell/delete.c b/servers/slapd/back-shell/delete.c index 1956969fbe..4a5b6cd2e3 100644 --- a/servers/slapd/back-shell/delete.c +++ b/servers/slapd/back-shell/delete.c @@ -36,7 +36,7 @@ shell_back_delete( /* write out the request to the delete process */ fprintf( wfp, "DELETE\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); fprintf( wfp, "dn: %s\n", dn ); fclose( wfp ); diff --git a/servers/slapd/back-shell/modify.c b/servers/slapd/back-shell/modify.c index ebaa3f10e9..108f13d697 100644 --- a/servers/slapd/back-shell/modify.c +++ b/servers/slapd/back-shell/modify.c @@ -38,7 +38,7 @@ shell_back_modify( /* write out the request to the modify process */ fprintf( wfp, "MODIFY\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); fprintf( wfp, "dn: %s\n", dn ); for ( ; ml != NULL; ml = ml->ml_next ) { diff --git a/servers/slapd/back-shell/modrdn.c b/servers/slapd/back-shell/modrdn.c index c04e83a375..c11f3cb552 100644 --- a/servers/slapd/back-shell/modrdn.c +++ b/servers/slapd/back-shell/modrdn.c @@ -52,7 +52,7 @@ shell_back_modrdn( /* write out the request to the modrdn process */ fprintf( wfp, "MODRDN\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); fprintf( wfp, "dn: %s\n", dn ); fprintf( wfp, "newrdn: %s\n", newrdn ); diff --git a/servers/slapd/back-shell/search.c b/servers/slapd/back-shell/search.c index 6f2bbb8d74..ce1642a7ec 100644 --- a/servers/slapd/back-shell/search.c +++ b/servers/slapd/back-shell/search.c @@ -27,9 +27,7 @@ shell_back_search( ) { struct shellinfo *si = (struct shellinfo *) be->be_private; - int i, rc, bsize, len; - int err; - char *matched, *info; + int i; FILE *rfp, *wfp; if ( si->si_search == NULL ) { @@ -47,7 +45,7 @@ shell_back_search( /* write out the request to the search process */ fprintf( wfp, "SEARCH\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); fprintf( wfp, "base: %s\n", base ); fprintf( wfp, "scope: %d\n", scope ); diff --git a/servers/slapd/back-shell/unbind.c b/servers/slapd/back-shell/unbind.c index f90792d876..ca644a7acd 100644 --- a/servers/slapd/back-shell/unbind.c +++ b/servers/slapd/back-shell/unbind.c @@ -35,7 +35,7 @@ shell_back_unbind( /* write out the request to the unbind process */ fprintf( wfp, "UNBIND\n" ); - fprintf( wfp, "msgid: %ld\n", op->o_msgid ); + fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid ); print_suffixes( wfp, be ); fprintf( wfp, "dn: %s\n", (conn->c_dn ? conn->c_dn : "") ); fclose( wfp ); diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 62e199a301..06dd261b89 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -59,7 +59,6 @@ static volatile sig_atomic_t slapd_shutdown = 0; static ldap_pvt_thread_t listener_tid; -static volatile sig_atomic_t slapd_listener = 0; static struct slap_daemon { ldap_pvt_thread_mutex_t sd_mutex; @@ -170,7 +169,7 @@ static void slapd_close(ber_socket_t s) { } -Listener * +static Listener * open_listener( const char* url, int port, @@ -447,7 +446,7 @@ slapd_daemon_task( int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: listen(%s, 5) failed errno=%d (%s)\n", - (long) slap_listeners[l]->sl_url, err, + slap_listeners[l]->sl_url, err, sock_errstr(err) ); return( (void*)-1 ); } @@ -742,7 +741,7 @@ slapd_daemon_task( } #else for ( i = 0; i < nfds; i++ ) { - int a, r, w; + int r, w; int is_listener = 0; for ( l = 0; slap_listeners[l] != NULL; l++ ) { diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index e81ed13582..154d8b3bb1 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -368,6 +368,9 @@ Syntax *syn_find_desc LDAP_P((const char *syndesc, int *slen)); int syn_add LDAP_P((LDAP_SYNTAX *syn, slap_syntax_check_func *check, const char **err)); MatchingRule *mr_find LDAP_P((const char *mrname)); int mr_add LDAP_P((LDAP_MATCHING_RULE *mr, slap_mr_normalize_func *normalize, slap_mr_compare_func *compare, const char **err)); +int case_ignore_normalize LDAP_P((struct berval *val, struct berval **normalized)); +int register_syntax LDAP_P((char *desc, slap_syntax_check_func *check )); +int register_matching_rule LDAP_P((char * desc, slap_mr_normalize_func *normalize, slap_mr_compare_func *compare)); void schema_info LDAP_P((Connection *conn, Operation *op, char **attrs, int attrsonly)); int schema_init LDAP_P((void)); diff --git a/servers/slapd/tools/centipede.c b/servers/slapd/tools/centipede.c index be3f03baab..695119f291 100644 --- a/servers/slapd/tools/centipede.c +++ b/servers/slapd/tools/centipede.c @@ -556,8 +556,10 @@ diff_centroids( int nentries ) { +#ifdef LDBM_ORDERED Datum okey, nkey; Datum olast, nlast; +#endif Datum lastkey, key; Datum data; LDAPMod **mods; @@ -573,10 +575,6 @@ diff_centroids( fflush( stdout ); } - ldbm_datum_init( okey ); - ldbm_datum_init( nkey ); - ldbm_datum_init( olast ); - ldbm_datum_init( nlast ); ldbm_datum_init( lastkey ); ldbm_datum_init( key ); ldbm_datum_init( data ); @@ -618,6 +616,11 @@ diff_centroids( * dual traversal, yielding O(N) performance. */ + ldbm_datum_init( okey ); + ldbm_datum_init( nkey ); + ldbm_datum_init( olast ); + ldbm_datum_init( nlast ); + olast.dptr = NULL; nlast.dptr = NULL; diff --git a/servers/slapd/tools/sizecount.c b/servers/slapd/tools/sizecount.c index 52f19d20eb..6b363c19f7 100644 --- a/servers/slapd/tools/sizecount.c +++ b/servers/slapd/tools/sizecount.c @@ -89,12 +89,8 @@ main( int argc, char **argv ) scount = 0; ssize = 0; if ( (bvals = ldap_get_values_len( ld, e, attrs[i] )) != NULL ) { for ( j = 0; bvals[j] != NULL; j++ ) { - Datum key, data; char *w; - ldbm_datum_init( key ); - ldbm_datum_init( data ); - /* update value count */ vcount++; vsize += bvals[j]->bv_len; -- 2.39.5