ldap/servers/plugins/replication/repl5_protocol.c | 26 ++++++++-------- ldap/servers/plugins/replication/repl5_replica_config.c | 2 - ldap/servers/slapd/pw.c | 4 +- 3 files changed, 17 insertions(+), 15 deletions(-)
New commits: commit a3c14c25726f4e156d0d8557129a054e7f8ed1c3 Author: Noriko Hosoi nhosoi@redhat.com Date: Thu Mar 28 15:40:47 2013 -0700
Ticket 458 - Need to properly check if the password admin dn is set
Bug description: coverity reported "13160 - Resource leak"
Fix description: generate pblock after checking NULl check for binddn.
https://fedorahosted.org/389/ticket/458
Reviewed by Nathan (Thank you!!)
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c index 3bb87d7..ae94903 100644 --- a/ldap/servers/slapd/pw.c +++ b/ldap/servers/slapd/pw.c @@ -1531,7 +1531,7 @@ pw_is_pwp_admin(Slapi_PBlock *pb, passwdPolicy *pwp){ static void pw_get_admin_users(passwdPolicy *pwp) { - Slapi_PBlock *pb = slapi_pblock_new(); + Slapi_PBlock *pb = NULL; const Slapi_DN *sdn = pwp->pw_admin; char **uniquemember_vals = NULL; char **member_vals = NULL; @@ -1546,9 +1546,11 @@ pw_get_admin_users(passwdPolicy *pwp) if(binddn == NULL){ return; } + /* * Check if the DN exists and has "group" objectclasses */ + pb = slapi_pblock_new(); slapi_search_internal_set_pb(pb, binddn, LDAP_SCOPE_BASE,"(|(objectclass=groupofuniquenames)(objectclass=groupofnames))", NULL, 0, NULL, NULL, (void *) plugin_get_default_component_id(), 0); slapi_search_internal_pb(pb);
commit 88ef8cb5f24aef88a43264d15b80ff9923ad1579 Author: Noriko Hosoi nhosoi@redhat.com Date: Thu Mar 28 15:36:31 2013 -0700
Ticket #618 - Crash at shutdown while stopping replica agreements
Bug description: coverity reported "13159 - Dereference after null check"
Fix description: call PR_JoinThread inside of (NULL != rp) clause.
https://fedorahosted.org/389/ticket/618
Reviewed by Nathan (Thank you!!)
diff --git a/ldap/servers/plugins/replication/repl5_protocol.c b/ldap/servers/plugins/replication/repl5_protocol.c index d9744fc..76e018a 100644 --- a/ldap/servers/plugins/replication/repl5_protocol.c +++ b/ldap/servers/plugins/replication/repl5_protocol.c @@ -401,38 +401,38 @@ prot_stop(Repl_Protocol *rp) { PR_Lock(rp->lock); rp->next_state = STATE_FINISHED; - if (NULL != rp->prp_incremental) - { - if (rp->prp_incremental->stop(rp->prp_incremental) != 0) + if (NULL != rp->prp_incremental) + { + if (rp->prp_incremental->stop(rp->prp_incremental) != 0) { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: incremental protocol for replica "%s" " "did not shut down properly.\n", agmt_get_long_name(rp->agmt)); } - } - if (NULL != rp->prp_total) - { - if (rp->prp_total->stop(rp->prp_total) != 0) + } + if (NULL != rp->prp_total) + { + if (rp->prp_total->stop(rp->prp_total) != 0) { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Warning: total protocol for replica "%s" " "did not shut down properly.\n", agmt_get_long_name(rp->agmt)); } - } + } PR_Unlock(rp->lock); + + if (rp->agmt_thread != NULL) { + (void) PR_JoinThread(rp->agmt_thread); + rp->agmt_thread = NULL; + } } else { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Error: prot_stop() " " called on NULL protocol instance.\n"); } - - if (rp->agmt_thread != NULL) { - (void) PR_JoinThread(rp->agmt_thread); - rp->agmt_thread = NULL; - } }
/*
commit d5fe6ba773ef2655845df5152901fd5bb6a9d4e9 Author: Noriko Hosoi nhosoi@redhat.com Date: Thu Mar 28 15:30:13 2013 -0700
Ticket 623 - cleanAllRUV task fails to cleanup config upon completion
Bug description: coverity reported "13158 - Logically dead code'
Fix description: csn_as_string returns allocated csn string, which needs to be reassigned to csnstr.
https://fedorahosted.org/389/ticket/623
Reviewed by Nathan (Thank you!!)
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c index b1aca41..c280ced 100644 --- a/ldap/servers/plugins/replication/repl5_replica_config.c +++ b/ldap/servers/plugins/replication/repl5_replica_config.c @@ -2396,7 +2396,7 @@ delete_cleaned_rid_config(cleanruv_data *clean_data) /* * If there is no maxcsn, set the proper csnstr */ - csn_as_string(clean_data->maxcsn, PR_FALSE, csnstr); + csnstr = csn_as_string(clean_data->maxcsn, PR_FALSE, csnstr); if(csnstr == NULL || csn_get_replicaid(clean_data->maxcsn) == 0){ csnstr = slapi_ch_strdup("00000000000000000000"); }
389-commits@lists.fedoraproject.org