]> git.sur5r.net Git - openldap/commitdiff
silence warnings
authorPierangelo Masarati <ando@openldap.org>
Sun, 6 Nov 2005 23:27:09 +0000 (23:27 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 6 Nov 2005 23:27:09 +0000 (23:27 +0000)
12 files changed:
include/ldap_pvt.h
libraries/libldap/tls.c
libraries/liblutil/tavl.c
servers/slapd/back-monitor/operation.c
servers/slapd/back-passwd/search.c
servers/slapd/backglue.c
servers/slapd/bconfig.c
servers/slapd/filterentry.c
servers/slapd/overlays/ppolicy.c
servers/slapd/overlays/valsort.c
servers/slapd/slaptest.c
tests/data/slapd-sql.conf

index 2d810b04e0125e7cfa1c6cf42ef6ac8c84540b3f..0ed0563b0d968da3772c4be139df89abf8311617 100644 (file)
@@ -279,6 +279,7 @@ LDAP_END_DECL
 #endif /* HAVE_OPENSSL_BN_H || HAVE_BN_H */
 
 typedef        BIGNUM*         ldap_pvt_mp_t;
+#define        LDAP_PVT_MP_INIT        (NULL)
 
 #define        ldap_pvt_mp_init(mp) \
        (mp) = BN_new()
@@ -305,6 +306,8 @@ typedef     BIGNUM*         ldap_pvt_mp_t;
 #endif
 
 typedef mpz_t          ldap_pvt_mp_t;
+#define        LDAP_PVT_MP_INIT        { 0 }
+
 #define ldap_pvt_mp_init(mp) \
        mpz_init((mp))
 
@@ -327,8 +330,10 @@ typedef mpz_t              ldap_pvt_mp_t;
 
 #ifdef HAVE_LONG_LONG
 typedef        unsigned long long      ldap_pvt_mp_t;
+#define        LDAP_PVT_MP_INIT        (0LL)
 #else /* !HAVE_LONG_LONG */
 typedef        unsigned long           ldap_pvt_mp_t;
+#define        LDAP_PVT_MP_INIT        (0L)
 #endif /* !HAVE_LONG_LONG */
 
 #define ldap_pvt_mp_init(mp) \
index 8cff2aa20750124957def387736a41ca2146a654..8eb01290cd1059ef4d59d0e48512dbd4ad67266b 100644 (file)
@@ -1783,7 +1783,7 @@ tls_tmp_dh_cb( SSL *ssl, int is_export, int key_length )
                        dhparams = p;
                }
        }
-done:
+
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_unlock( &tls_def_ctx_mutex );
 #endif
index f588c71d8801b2e10de5e3f62f70ce1cb34bf54d..41e8d630181fc67a6f50803f82dada79a8ed5033 100644 (file)
@@ -186,7 +186,7 @@ void*
 tavl_delete( Avlnode **root, void* data, AVL_CMP fcmp )
 {
        Avlnode *p, *q, *r, *top;
-       int side, side_bf, shorter, nside;
+       int side, side_bf, shorter, nside = -1;
 
        /* parent stack */
        Avlnode *pptr[sizeof(void *)*8];
index f7aa7c6483309e4ab9773acce631a519a88c3181..68a006362c1323f1a52395d407e60ce5ef730adf 100644 (file)
@@ -189,8 +189,8 @@ monitor_subsys_ops_update(
 {
        monitor_info_t          *mi = ( monitor_info_t * )op->o_bd->be_private;
 
-       ldap_pvt_mp_t           nInitiated,
-                               nCompleted;
+       ldap_pvt_mp_t           nInitiated = LDAP_PVT_MP_INIT,
+                               nCompleted = LDAP_PVT_MP_INIT;
        struct berval           rdn;
        int                     i;
        Attribute               *a;
index 76386d756b0d415c524ce8a15cc49e24a2d1bdb0..f34f80d52370234d414176ccc8eb0b481cd0be13 100644 (file)
@@ -59,7 +59,7 @@ passwd_back_search(
     SlapReply  *rs )
 {
        struct passwd   *pw;
-       time_t          stoptime;
+       time_t          stoptime = (time_t)-1;
 
        LDAPRDN rdn = NULL;
        struct berval parent = BER_BVNULL;
index 777a7272c5c8435c4d69054657c3eac54bdedd23..99d88b0816949b93c541b51a8de1711468d04ea9 100644 (file)
@@ -157,7 +157,7 @@ glue_op_func ( Operation *op, SlapReply *rs )
        BackendDB *b0 = op->o_bd;
        BackendInfo *bi0 = op->o_bd->bd_info;
        BI_op_modify **func;
-       slap_operation_t which;
+       slap_operation_t which = op_bind;
        int rc;
 
        op->o_bd = glue_back_select (b0, &op->o_req_ndn);
@@ -168,6 +168,7 @@ glue_op_func ( Operation *op, SlapReply *rs )
        case LDAP_REQ_DELETE: which = op_delete; break;
        case LDAP_REQ_MODIFY: which = op_modify; break;
        case LDAP_REQ_MODRDN: which = op_modrdn; break;
+       default: assert( 0 ); break;
        }
 
        func = &op->o_bd->bd_info->bi_op_bind;
index 354411226159eb251a067a5ff17491f85e6acd34..bd7ccc8d4f9b341d8abed826d82b48359ca5a2c6 100644 (file)
@@ -2377,7 +2377,7 @@ replica_unparse( struct slap_replica_info *ri, int i, struct berval *bv )
 static int
 config_replica(ConfigArgs *c) {
        int i, nr = -1;
-       char *replicahost, *replicauri;
+       char *replicahost = NULL, *replicauri = NULL;
        LDAPURLDesc *ludp;
 
        if (c->op == SLAP_CONFIG_EMIT) {
@@ -2407,6 +2407,12 @@ config_replica(ConfigArgs *c) {
                if(!strncasecmp(c->argv[i], "host=", STRLENOF("host="))) {
                        ber_len_t       len;
 
+                       if ( replicauri ) {
+                               snprintf( c->msg, sizeof( c->msg ), "<%s> replica host/URI already specified", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg, replicauri );
+                               return(1);
+                       }
+
                        replicahost = c->argv[i] + STRLENOF("host=");
                        len = strlen( replicahost ) + STRLENOF("ldap://");
                        replicauri = ch_malloc( len + 1 );
@@ -2415,6 +2421,12 @@ config_replica(ConfigArgs *c) {
                        nr = add_replica_info(c->be, replicauri, replicahost);
                        break;
                } else if(!strncasecmp(c->argv[i], "uri=", STRLENOF("uri="))) {
+                       if ( replicauri ) {
+                               snprintf( c->msg, sizeof( c->msg ), "<%s> replica host/URI already specified", c->argv[0] );
+                               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg, replicauri );
+                               return(1);
+                       }
+
                        if(ldap_url_parse(c->argv[i] + STRLENOF("uri="), &ludp) != LDAP_SUCCESS) {
                                snprintf( c->msg, sizeof( c->msg ), "<%s> invalid uri", c->argv[0] );
                                Debug(LDAP_DEBUG_ANY, "%s: %s\n", c->log, c->msg, 0 );
@@ -2442,7 +2454,8 @@ config_replica(ConfigArgs *c) {
                return(1);
        } else if(nr == -1) {
                snprintf( c->msg, sizeof( c->msg ), "<%s> unable to add replica", c->argv[0] );
-               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg, replicauri );
+               Debug(LDAP_DEBUG_ANY, "%s: %s \"%s\"\n", c->log, c->msg,
+                       replicauri ? replicauri : "" );
                return(1);
        } else {
                for(i = 1; i < c->argc; i++) {
@@ -2622,6 +2635,7 @@ config_tls_option(ConfigArgs *c) {
        default:                Debug(LDAP_DEBUG_ANY, "%s: "
                                        "unknown tls_option <0x%x>\n",
                                        c->log, c->type, 0);
+               return 1;
        }
        if (c->op == SLAP_CONFIG_EMIT) {
                return ldap_pvt_tls_get_option( NULL, flag, &c->value_string );
@@ -2656,6 +2670,7 @@ config_tls_config(ConfigArgs *c) {
                Debug(LDAP_DEBUG_ANY, "%s: "
                                "unknown tls_option <0x%x>\n",
                                c->log, c->type, 0);
+               return 1;
        }
        if (c->op == SLAP_CONFIG_EMIT) {
                ldap_pvt_tls_get_option( NULL, flag, &c->value_int );
@@ -3120,7 +3135,7 @@ check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e,
        CfEntryInfo *ce;
        int index = -1, gotindex = 0, nsibs;
        int renumber = 0, tailindex = 0;
-       char *ptr1, *ptr2;
+       char *ptr1, *ptr2 = NULL;
        struct berval rdn;
 
        if ( renum ) *renum = 0;
@@ -3626,7 +3641,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
                switch (ml->sml_op) {
                case LDAP_MOD_DELETE:
                case LDAP_MOD_REPLACE: {
-                       BerVarray vals = NULL, nvals;
+                       BerVarray vals = NULL, nvals = NULL;
                        int *idx = NULL;
                        if ( ct && ( ct->arg_type & ARG_NO_DELETE )) {
                                rc = LDAP_OTHER;
@@ -3737,9 +3752,9 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
                        switch (ml->sml_op) {
                        case LDAP_MOD_DELETE:
                        case LDAP_MOD_REPLACE: {
-                               BerVarray vals = NULL, nvals;
+                               BerVarray vals = NULL, nvals = NULL;
                                Attribute *a;
-                               delrec *d;
+                               delrec *d = NULL;
 
                                a = attr_find( e->e_attrs, ml->sml_desc );
 
index 34b8bc784f0643b34a7f48bc06ba85b52fb1e083..b0e5a595d72219c54a77658c107171ece401a8b1 100644 (file)
@@ -158,7 +158,7 @@ static int test_mra_filter(
        void            *memctx;
        BER_MEMFREE_FN  *memfree;
 #ifdef LDAP_COMP_MATCH
-       int i, num_attr_vals;
+       int i, num_attr_vals = 0;
 #endif
 
        if ( op == NULL ) {
index c2d7fe65ac2a461ccbfea37a91730c5393c730d7..93d93c4c584d495315554a913a98d38bcebd7c7f 100644 (file)
@@ -1155,10 +1155,11 @@ ppolicy_modify( Operation *op, SlapReply *rs )
 {
        slap_overinst           *on = (slap_overinst *)op->o_bd->bd_info;
        pp_info                 *pi = on->on_bi.bi_private;
-       int                     i, rc, mod_pw_only, pwmod, pwmop, deladd,
+       int                     i, rc, mod_pw_only, pwmod, pwmop = -1, deladd,
                                hsize = 0;
        PassPolicy              pp;
-       Modifications           *mods = NULL, *modtail, *ml, *delmod, *addmod;
+       Modifications           *mods = NULL, *modtail = NULL,
+                               *ml, *delmod, *addmod;
        Attribute               *pa, *ha, at;
        const char              *txt;
        pw_hist                 *tl = NULL, *p;
@@ -1290,12 +1291,13 @@ ppolicy_modify( Operation *op, SlapReply *rs )
 
        ppolicy_get( op, e, &pp );
 
-       for(ml = op->oq_modify.rs_modlist,
+       for ( ml = op->oq_modify.rs_modlist,
                        pwmod = 0, mod_pw_only = 1,
                        deladd = 0, delmod = NULL,
                        addmod = NULL,
                        zapReset = 1;
-               ml != NULL; modtail = ml, ml = ml->sml_next ) {
+               ml != NULL; modtail = ml, ml = ml->sml_next )
+       {
                if ( ml->sml_desc == pp.ad ) {
                        pwmod = 1;
                        pwmop = ml->sml_op;
index c273eb361ceb267b34c8f65b694595e2f0b96cb4..0c206abbae2b79f2de846208a5907df033a6aafa 100644 (file)
@@ -212,7 +212,7 @@ static void
 do_sort( Operation *op, Attribute *a, int beg, int num, slap_mask_t sort )
 {
        int i, j, gotnvals;
-       struct berval tmp, ntmp, *vals, *nvals;
+       struct berval tmp, ntmp, *vals = NULL, *nvals;
 
        gotnvals = (a->a_vals != a->a_nvals );
 
index 245389223006170efbd49f1d80876b6e30ad5955..85f08edc073efe7f7c0bd05caee9290feeee73ff 100644 (file)
@@ -79,6 +79,8 @@ test_file( const char *fname, const char *ftype )
                        save_errno, strerror( save_errno ) );
                return -1;
        }
+
+       return 0;
 }
 
 int
index 8b7ae7dc40bf0b22df62b22e3e999168f0166bd3..a93b00ede9c136969df832c7aa7a61fb23ac8b31 100644 (file)
@@ -32,8 +32,8 @@ argsfile      @TESTDIR@/slapd.1.args
 # cn=monitor, cn=schema, and cn=config
 #
 
-access to attr=userpassword
-       by self =wx
+access to attrs=userpassword
+       by self =w
        by anonymous =x
 
 access to *