Commit c0e3958c authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fixed slapd req_pwdexop bug

    Fixed slapo-syncprov queued UUIDs bug (ITS#4068)
    Fixed slapo-syncprov memory leak
    Fixed slapd anlist leak
    Removed lint
    Build Environment
        Updated testsuite to test only primary backends by default
        Disable test041-aci
parent 7819bd0b
OpenLDAP 2.3 Change Log
OpenLDAP 2.3.9 Engineering
Fixed slapd req_pwdexop bug
Fixed slapo-syncprov queued UUIDs bug (ITS#4068)
Fixed slapo-syncprov memory leak
Fixed slapd anlist leak
Removed lint
Build Environment
Updated testsuite to test only primary backends by default
Disable test041-aci
OpenLDAP 2.3.8 Release
......
......@@ -988,8 +988,9 @@ anlist2attrs( AttributeName * anlist )
char **attrs;
ObjectClass *oc;
attrs = anlist2charray( anlist, 1 );
if ( anlist == NULL )
return NULL;
for ( i = 0; anlist[i].an_name.bv_val; i++ ) {
if ( ( oc = anlist[i].an_oc ) ) {
for ( j = 0; oc->soc_required && oc->soc_required[j]; j++ ) ;
......@@ -1002,6 +1003,8 @@ anlist2attrs( AttributeName * anlist )
if ( i == 0 )
return NULL;
attrs = anlist2charray( anlist, 1 );
n = i;
if ( k )
......@@ -1026,9 +1029,8 @@ anlist2attrs( AttributeName * anlist )
i = 0;
while ( attrs && attrs[i] ) {
if ( *attrs[i] == '@' ) {
ch_free( attrs[i] );
for ( j = i; attrs[j]; j++ ) {
if ( j == i )
ch_free( attrs[i] );
attrs[j] = attrs[j+1];
}
} else {
......@@ -1040,9 +1042,8 @@ anlist2attrs( AttributeName * anlist )
j = i + 1;
while ( attrs && attrs[j] ) {
if ( !strcmp( attrs[i], attrs[j] )) {
ch_free( attrs[j] );
for ( k = j; attrs && attrs[k]; k++ ) {
if ( k == j )
ch_free( attrs[j] );
attrs[k] = attrs[k+1];
}
} else {
......
......@@ -207,7 +207,7 @@ static struct slap_daemon {
#define SLAP_SOCK_IS_MUTE(s) (!SLAP_SOCK_IS_READ(s))
#define SLAP_SOCK_SET_INIT \
slap_daemon.sd_epolls = ch_malloc(sizeof(struct epoll_event) * dtblsize * 2); \
slap_daemon.sd_epolls = ch_calloc(1, sizeof(struct epoll_event) * dtblsize * 2); \
slap_daemon.sd_index = ch_malloc(sizeof(int) * dtblsize); \
slap_daemon.sd_epfd = epoll_create( dtblsize ); \
for (i=0; i<dtblsize; i++) slap_daemon.sd_index[i] = -1
......
......@@ -55,7 +55,8 @@ slap_compose_sync_cookie(
"csn=%s,rid=%03d", csn->bv_val, rid );
}
}
ber_str2bv( cookiestr, strlen(cookiestr), 1, cookie );
ber_str2bv_x( cookiestr, strlen(cookiestr), 1, cookie,
op ? op->o_tmpmemctx : NULL );
}
void
......
......@@ -749,6 +749,7 @@ syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry **e, int mod
a_uuid.a_nvals = &opc->suuid;
rs.sr_err = syncprov_state_ctrl( op, &rs, &e_uuid,
mode, ctrls, 0, 1, &cookie );
op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
rs.sr_ctrls = ctrls;
op->o_bd->bd_info = (BackendInfo *)on->on_info;
......@@ -910,13 +911,14 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode )
sr->s_dn.bv_len = opc->sdn.bv_len;
sr->s_mode = mode;
sr->s_isreference = opc->sreference;
sr->s_ndn.bv_val = lutil_strcopy( sr->s_dn.bv_val, opc->sdn.bv_val );
sr->s_ndn.bv_val = lutil_strcopy( sr->s_dn.bv_val,
opc->sdn.bv_val ) + 1;
sr->s_ndn.bv_len = opc->sndn.bv_len;
*(sr->s_ndn.bv_val++) = '\0';
sr->s_uuid.bv_val = lutil_strcopy( sr->s_ndn.bv_val, opc->sndn.bv_val );
sr->s_uuid.bv_val = lutil_strcopy( sr->s_ndn.bv_val,
opc->sndn.bv_val ) + 1;
sr->s_uuid.bv_len = opc->suuid.bv_len;
*(sr->s_uuid.bv_val++) = '\0';
sr->s_csn.bv_val = lutil_strcopy( sr->s_uuid.bv_val, opc->suuid.bv_val );
AC_MEMCPY( sr->s_uuid.bv_val, opc->suuid.bv_val, opc->suuid.bv_len );
sr->s_csn.bv_val = sr->s_uuid.bv_val + sr->s_uuid.bv_len + 1;
sr->s_csn.bv_len = opc->sctxcsn.bv_len;
strcpy( sr->s_csn.bv_val, opc->sctxcsn.bv_val );
......@@ -1810,11 +1812,13 @@ syncprov_search_response( Operation *op, SlapReply *rs )
rs->sr_err = syncprov_done_ctrl( op, rs, rs->sr_ctrls,
0, 1, &cookie, ss->ss_present ? LDAP_SYNC_REFRESH_PRESENTS :
LDAP_SYNC_REFRESH_DELETES );
op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
} else {
/* It's RefreshAndPersist, transition to Persist phase */
syncprov_sendinfo( op, rs, ( ss->ss_present && rs->sr_nentries ) ?
LDAP_TAG_SYNC_REFRESH_PRESENT : LDAP_TAG_SYNC_REFRESH_DELETE,
&cookie, 1, NULL, 0 );
op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
/* Detach this Op from frontend control */
ldap_pvt_thread_mutex_lock( &ss->ss_so->s_mutex );
......
......@@ -68,7 +68,9 @@ int passwd_extop(
return LDAP_STRONG_AUTH_REQUIRED;
}
qpw->rs_old.bv_len = 0;
qpw->rs_old.bv_val = NULL;
qpw->rs_new.bv_len = 0;
qpw->rs_new.bv_val = NULL;
qpw->rs_mods = NULL;
qpw->rs_modtail = NULL;
......
......@@ -1948,8 +1948,7 @@ typedef struct req_extended_s {
} req_extended_s;
typedef struct req_pwdexop_s {
struct berval rs_reqoid;
int rs_flags;
struct req_extended_s rs_extended;
struct berval rs_old;
struct berval rs_new;
Modifications *rs_mods;
......
......@@ -231,9 +231,8 @@ init_syncrepl(syncinfo_t *si)
j = 0;
while ( exattrs[j] != NULL ) {
if ( !strcmp( exattrs[j], sync_descs[i]->ad_cname.bv_val )) {
ch_free( exattrs[j] );
for ( k = j; exattrs[k] != NULL; k++ ) {
if ( k == j )
ch_free( exattrs[k] );
exattrs[k] = exattrs[k+1];
}
} else {
......@@ -250,9 +249,8 @@ init_syncrepl(syncinfo_t *si)
while ( oc->soc_required[k] ) {
if ( !strcmp( exattrs[i],
oc->soc_required[k]->sat_cname.bv_val )) {
ch_free( exattrs[i] );
for ( l = i; exattrs[l]; l++ ) {
if ( l == i )
ch_free( exattrs[i] );
exattrs[l] = exattrs[l+1];
}
} else {
......
......@@ -21,9 +21,13 @@ BUILD_HDB=@BUILD_HDB@
BUILD_LDBM=@BUILD_LDBM@
BUILD_SQL=@BUILD_SQL@
# test primary backends (default)
test tests:
@$(MAKE) bdb
@$(MAKE) hdb
# test all backends
alltests: tests
@$(MAKE) ldbm
@$(MAKE) sql
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment