#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()
#endif
typedef mpz_t ldap_pvt_mp_t;
+#define LDAP_PVT_MP_INIT { 0 }
+
#define ldap_pvt_mp_init(mp) \
mpz_init((mp))
#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) \
dhparams = p;
}
}
-done:
+
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &tls_def_ctx_mutex );
#endif
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];
{
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;
SlapReply *rs )
{
struct passwd *pw;
- time_t stoptime;
+ time_t stoptime = (time_t)-1;
LDAPRDN rdn = NULL;
struct berval parent = BER_BVNULL;
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);
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;
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) {
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 );
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 );
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++) {
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 );
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 );
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;
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;
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 );
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 ) {
{
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;
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;
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 );
save_errno, strerror( save_errno ) );
return -1;
}
+
+ return 0;
}
int
# 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 *