From 7ab3d2c2458055a5c32d6370197ed7106a97d8cc Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Thu, 14 Jul 2005 19:32:21 +0000 Subject: [PATCH] Silence warnings --- servers/slapd/overlays/accesslog.c | 1 - servers/slapd/overlays/glue.c | 7 +------ servers/slapd/overlays/lastmod.c | 3 --- servers/slapd/overlays/ppolicy.c | 27 +++++++++------------------ servers/slapd/overlays/refint.c | 2 +- servers/slapd/overlays/rwm.c | 2 -- servers/slapd/overlays/syncprov.c | 7 ------- servers/slapd/overlays/translucent.c | 10 ++-------- 8 files changed, 13 insertions(+), 46 deletions(-) diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index cdac2f7801..3d7a5d274d 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -342,7 +342,6 @@ static struct { static int log_age_parse(char *agestr) { - char *ptr; int t1, t2; int gotdays = 0; diff --git a/servers/slapd/overlays/glue.c b/servers/slapd/overlays/glue.c index 6e4e0836a1..9c5c92bec3 100644 --- a/servers/slapd/overlays/glue.c +++ b/servers/slapd/overlays/glue.c @@ -164,7 +164,6 @@ static int glue_op_func ( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; - glueinfo *gi = (glueinfo *)on->on_bi.bi_private; BackendDB *b0 = op->o_bd; BackendInfo *bi0 = op->o_bd->bd_info; BI_op_modify **func; @@ -196,7 +195,6 @@ static int glue_chk_referrals ( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; - glueinfo *gi = (glueinfo *)on->on_bi.bi_private; BackendDB *b0 = op->o_bd; BackendInfo *bi0 = op->o_bd->bd_info; int rc; @@ -218,7 +216,6 @@ static int glue_chk_controls ( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; - glueinfo *gi = (glueinfo *)on->on_bi.bi_private; BackendDB *b0 = op->o_bd; BackendInfo *bi0 = op->o_bd->bd_info; int rc = SLAP_CB_CONTINUE; @@ -527,9 +524,8 @@ glue_close ( ) { slap_overinst *on = glue_tool_inst( bi ); - glueinfo *gi = on->on_bi.bi_private; static int glueClosed = 0; - int i, rc = 0; + int rc = 0; if (glueClosed) return 0; @@ -803,7 +799,6 @@ glue_db_config( int i, async = 0, advertise = 0; BackendDB *b2; struct berval bv, dn; - gluenode *gn; if ( argc < 2 ) { fprintf( stderr, "%s: line %d: too few arguments in " diff --git a/servers/slapd/overlays/lastmod.c b/servers/slapd/overlays/lastmod.c index 8a9996708f..07e06eb0d2 100644 --- a/servers/slapd/overlays/lastmod.c +++ b/servers/slapd/overlays/lastmod.c @@ -283,7 +283,6 @@ lastmod_op_func( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; - unsigned i; Modifications *ml; if ( dn_match( &op->o_req_ndn, &lmi->lmi_e->e_nname ) ) { @@ -692,7 +691,6 @@ lastmod_response( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private; - unsigned int i; /* don't record failed operations */ switch ( rs->sr_err ) { @@ -730,7 +728,6 @@ lastmod_response( Operation *op, SlapReply *rs ) } ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex ); -process:; (void)lastmod_update( op, rs ); return SLAP_CB_CONTINUE; diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c index 4b29520517..7393f150a4 100644 --- a/servers/slapd/overlays/ppolicy.c +++ b/servers/slapd/overlays/ppolicy.c @@ -211,8 +211,6 @@ account_locked( Operation *op, Entry *e, PassPolicy *pp, Modifications **mod ) { Attribute *la; - int rc; - Entry *de; assert(mod); @@ -225,7 +223,6 @@ account_locked( Operation *op, Entry *e, */ if (vals[0].bv_val != NULL) { time_t then, now; - struct berval bv; Modifications *m; if (!pp->pwdLockoutDuration) @@ -310,12 +307,11 @@ ppolicy_get( Operation *op, Entry *e, PassPolicy *pp ) pp_info *pi = on->on_bi.bi_private; Attribute *a; BerVarray vals; - int i, rc, nent; + int rc; Entry *pe = NULL; - AttributeDescription *oca = slap_schema.si_ad_objectClass; +#if 0 const char *text; - AttributeDescription *ad; - struct berval bv; +#endif memset( pp, 0, sizeof(PassPolicy) ); @@ -432,7 +428,6 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE { int rc = LDAP_SUCCESS, ok = LDAP_SUCCESS; char *ptr = cred->bv_val; - char *modpath; struct berval sch; assert( cred != NULL ); @@ -681,10 +676,9 @@ ppolicy_bind_resp( Operation *op, SlapReply *rs ) slap_overinst *on = ppb->on; Modifications *mod = ppb->mod, *m; int pwExpired = 0; - int ngut = -1, warn = -1, age, rc, i; + int ngut = -1, warn = -1, age, rc; Attribute *a; - time_t now, then, pwtime = (time_t)-1; - const char *txt; + time_t now, pwtime = (time_t)-1; char nowstr[ LDAP_LUTIL_GENTIME_BUFSIZE ]; struct berval timestamp; BackendInfo *bi = op->o_bd->bd_info; @@ -953,7 +947,7 @@ ppolicy_bind( Operation *op, SlapReply *rs ) /* Root bypasses policy */ if ( !be_isroot_dn( op->o_bd, &op->o_req_ndn )) { Entry *e; - int i, rc; + int rc; ppbind *ppb; slap_callback *cb; @@ -1017,7 +1011,7 @@ ppolicy_restrict( SlapReply *rs ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; - int i, send_ctrl = 0; + int send_ctrl = 0; /* Did we receive a password policy request control? */ if ( op->o_ctrlflag[ppolicy_cid] ) { @@ -1052,7 +1046,6 @@ ppolicy_add( slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; pp_info *pi = on->on_bi.bi_private; PassPolicy pp; - int pw; Attribute *pa; const char *txt; @@ -1071,7 +1064,7 @@ ppolicy_add( ppolicy_get( op, op->ora_e, &pp ); if (pp.pwdCheckQuality > 0 && !be_isroot( op )) { struct berval *bv = &(pa->a_vals[0]); - int rc, i, send_ctrl = 0; + int rc, send_ctrl = 0; LDAPPasswordPolicyError pErr = PP_noError; /* Did we receive a password policy request control? */ @@ -1149,7 +1142,7 @@ ppolicy_modify( Operation *op, SlapReply *rs ) hsize = 0; PassPolicy pp; Modifications *mods = NULL, *modtail, *ml, *delmod, *addmod; - Attribute *pa, *ha, *ra, at; + Attribute *pa, *ha, at; const char *txt; pw_hist *tl = NULL, *p; int zapReset, send_ctrl = 0; @@ -1271,7 +1264,6 @@ ppolicy_modify( Operation *op, SlapReply *rs ) if (pp.pwdInHistory > 0 && (ha = attr_find( e->e_attrs, ad_pwdHistory ))) { struct berval oldpw; time_t oldtime; - char *oid; for(i=0; ha->a_nvals[i].bv_val; i++) { rc = parse_pwdhistory( &(ha->a_nvals[i]), NULL, @@ -1438,7 +1430,6 @@ do_modify: struct berval timestamp; char timebuf[ LDAP_LUTIL_GENTIME_BUFSIZE ]; time_t now = slap_get_time(); - Attribute *ga; /* * keep the necessary pwd.. operational attributes diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c index a233fec070..b6e175fa72 100644 --- a/servers/slapd/overlays/refint.c +++ b/servers/slapd/overlays/refint.c @@ -570,7 +570,7 @@ refint_response( rc = nop.o_bd->be_search(&nop, &nrs); ch_free( nop.ors_filterstr.bv_val ); - while ( fptr = ftop.f_or ) { + while ( (fptr = ftop.f_or) != NULL ) { ftop.f_or = fptr->f_next; ch_free( fptr ); } diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index e485b06348..3da26b2686 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -258,8 +258,6 @@ static int rwm_op_bind( Operation *op, SlapReply *rs ) { slap_overinst *on = (slap_overinst *) op->o_bd->bd_info; - struct ldaprwmap *rwmap = - (struct ldaprwmap *)on->on_bi.bi_private; int rc; #ifdef ENABLE_REWRITE diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index a8c6398243..ca18cc0ae0 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -159,8 +159,6 @@ syncprov_state_ctrl( { Attribute* a; int ret; - int res; - const char *text = NULL; BerElementBuffer berbuf; BerElement *ber = (BerElement *)&berbuf; @@ -402,7 +400,6 @@ syncprov_findbase( Operation *op, fbase_cookie *fc ) { opcookie *opc = op->o_callback->sc_private; slap_overinst *on = opc->son; - syncprov_info_t *si = on->on_bi.bi_private; slap_callback cb = {0}; Operation fop; @@ -746,7 +743,6 @@ static int syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry **e, int mode, int queue ) { slap_overinst *on = opc->son; - syncprov_info_t *si = on->on_bi.bi_private; SlapReply rs = { REP_SEARCH }; LDAPControl *ctrls[2]; @@ -1231,7 +1227,6 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl, struct berval *oldcsn, struct berval *ctxcsn ) { slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; - syncprov_info_t *si = on->on_bi.bi_private; slog_entry *se; int i, j, ndel, num, nmods, mmods; BerVarray uuids; @@ -1692,11 +1687,9 @@ syncprov_search_response( Operation *op, SlapReply *rs ) { searchstate *ss = op->o_callback->sc_private; slap_overinst *on = ss->ss_on; - syncprov_info_t *si = on->on_bi.bi_private; sync_control *srs = op->o_controls[slap_cids.sc_LDAPsync]; if ( rs->sr_type == REP_SEARCH || rs->sr_type == REP_SEARCHREF ) { - int i; /* If we got a referral without a referral object, there's * something missing that we cannot replicate. Just ignore it. * The consumer will abort because we didn't send the expected diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c index ba948e6193..72b57e76d5 100644 --- a/servers/slapd/overlays/translucent.c +++ b/servers/slapd/overlays/translucent.c @@ -221,7 +221,6 @@ static int translucent_modify(Operation *op, SlapReply *rs) { slap_overinst *on = (slap_overinst *) op->o_bd->bd_info; overlay_stack *ov = on->on_bi.bi_private; - translucent_configuration *cf = ov->config; void *private = op->o_bd->be_private; Entry ne, *e, *re = NULL; Attribute *a, *ax; @@ -393,11 +392,9 @@ static int translucent_compare(Operation *op, SlapReply *rs) { slap_overinst *on = (slap_overinst *) op->o_bd->bd_info; overlay_stack *ov = on->on_bi.bi_private; void *private = op->o_bd->be_private; - translucent_configuration *cf = ov->config; AttributeAssertion *ava = op->orc_ava; - Attribute *a, *an, *ra, *as = NULL; - Entry *e, *ee, *re; + Entry *e; int rc; Debug(LDAP_DEBUG_TRACE, "==> translucent_compare: <%s> %s:%s\n", @@ -440,9 +437,8 @@ static int translucent_search_cb(Operation *op, SlapReply *rs) { slap_overinst *on; Entry *e, *re = NULL; Attribute *a, *ax, *an, *as = NULL; - BerVarray b, bx; void *private; - int i, rc, size; + int rc; if(!op || !rs || rs->sr_type != REP_SEARCH || !rs->sr_entry) return(SLAP_CB_CONTINUE); @@ -525,7 +521,6 @@ static int translucent_search(Operation *op, SlapReply *rs) { slap_overinst *on = (slap_overinst *) op->o_bd->bd_info; slap_callback cb = { NULL, NULL, NULL, NULL }; overlay_stack *ov = on->on_bi.bi_private; - translucent_configuration *cf = ov->config; void *private = op->o_bd->be_private; int rc; @@ -708,7 +703,6 @@ static int translucent_open(BackendDB *be) { static int translucent_close(BackendDB *be) { slap_overinst *on = (slap_overinst *) be->bd_info; overlay_stack *ov = on->on_bi.bi_private; - translucent_configuration *cf = ov->config; void *private = be->be_private; int rc; -- 2.39.5