ldap/servers/plugins/acl/acl.c | 10 ++++++++++
ldap/servers/plugins/collation/collate.c | 2 +-
ldap/servers/plugins/replication/cl5_api.c | 5 +----
ldap/servers/plugins/replication/csnpl.c | 2 +-
ldap/servers/plugins/replication/windows_protocol_util.c | 2 +-
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 2 +-
ldap/servers/slapd/plugin_internal_op.c | 2 +-
ldap/servers/slapd/tools/rsearch/sdattable.c | 4 ++--
8 files changed, 18 insertions(+), 11 deletions(-)
New commits:
commit 67e2651847a7a1afbd307462106a23804ed99f62
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 14:19:24 2011 -0600
Bug 691422 - windows_replay_update - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: windows_replay_update - fix coverity control flow issues
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: is_ours will always be true here - so just remove the ?: statement
and hard code "ours"
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c
b/ldap/servers/plugins/replication/windows_protocol_util.c
index dc3754b..3290e8d 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -1423,7 +1423,7 @@ windows_replay_update(Private_Repl_Protocol *prp,
slapi_operation_parameters *op
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"%s: windows_replay_update: Looking at %s operation local dn=\"%s\"
(%s)\n",
agmt_get_long_name(prp->agmt),
- op2string(op->operation_type), op->target_address.dn, is_ours ?
"ours" : "not ours");
+ op2string(op->operation_type), op->target_address.dn, "ours");
}
/* Just bail on this change. We don't want to do any
* further checks since we don't have a local entry. */
commit 09f09816352f18e799abe5e25916f6c375b64bbf
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 14:16:32 2011 -0600
Bug 691422 - cl5WriteRUV - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: cl5WriteRUV - fix coverity control flow issues
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: file_obj will always be NULL here, so just remove the code
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/cl5_api.c
b/ldap/servers/plugins/replication/cl5_api.c
index 6f75d7f..b7e56fa 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -6302,9 +6302,6 @@ cl5WriteRUV()
}
file_obj = objset_next_obj(s_cl5Desc.dbFiles, file_obj);
}
- if (file_obj) {
- object_release (file_obj);
- }
bail:
if (closeit && (CL5_STATE_OPEN == s_cl5Desc.dbState)) {
_cl5Close ();
commit 3cb50e12fec36e32c738f08b4d9f0baef341f916
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 14:14:50 2011 -0600
Bug 691422 - search_internal_callback_pb - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: search_internal_callback_pb - fix coverity control flow issues
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: just get rid of the ifstr ?: - it is ok to pass a NULL to
slapi_ch_strdup anyway.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/plugin_internal_op.c
b/ldap/servers/slapd/plugin_internal_op.c
index 031fbcc..76f70e8 100644
--- a/ldap/servers/slapd/plugin_internal_op.c
+++ b/ldap/servers/slapd/plugin_internal_op.c
@@ -719,7 +719,7 @@ static int search_internal_callback_pb (Slapi_PBlock *pb, void
*callback_data,
op->o_search_entry_handler = internal_srch_entry_callback;
op->o_search_referral_handler = internal_ref_entry_callback;
- filter = slapi_str2filter(ifstr ? (fstr = slapi_ch_strdup(ifstr)) : NULL);
+ filter = slapi_str2filter((fstr = slapi_ch_strdup(ifstr)));
if(scope == LDAP_SCOPE_BASE) {
filter->f_flags |= (SLAPI_FILTER_LDAPSUBENTRY |
SLAPI_FILTER_TOMBSTONE | SLAPI_FILTER_RUV);
commit 90919bb41f89cfc376d170c4b0b6c790b7ba96d3
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 14:12:13 2011 -0600
Bug 691422 - acl_read_access_allowed_on_entry - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: acl_read_access_allowed_on_entry - fix coverity control flow issues
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: ifdef out all code related to
DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c
index e42a83a..2794694 100644
--- a/ldap/servers/plugins/acl/acl.c
+++ b/ldap/servers/plugins/acl/acl.c
@@ -846,7 +846,9 @@ acl_read_access_allowed_on_entry (
Slapi_Attr *currAttr;
Slapi_Attr *nextAttr;
int len;
+#ifdef DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES
int attr_index = -1;
+#endif
char *attr_type = NULL;
int rv, isRoot;
char *clientDn;
@@ -1055,6 +1057,7 @@ acl_read_access_allowed_on_entry (
aclpb->aclpb_Evalattr = slapi_ch_malloc(len+1);
}
PL_strncpyz (aclpb->aclpb_Evalattr, attr_type, len);
+#ifdef DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES
if ( attr_index >= 0 ) {
/*
* access was granted to one of the user specified attributes
@@ -1064,13 +1067,16 @@ acl_read_access_allowed_on_entry (
aclpb->aclpb_state |=
ACLPB_ACCESS_ALLOWED_USERATTR;
} else {
+#endif /* DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES */
/*
* Access was granted to _an_ attribute in the entry and that
* attribute is now in aclpb_Evalattr
*/
aclpb->aclpb_state |=
ACLPB_ACCESS_ALLOWED_ON_A_ATTR;
+#ifdef DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES
}
+#endif /* DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES */
TNF_PROBE_1_DEBUG(acl_read_access_allowed_on_entry_end ,
"ACL","",
tnf_string,called_access_allowed,"");
@@ -1078,9 +1084,11 @@ acl_read_access_allowed_on_entry (
} else {
/* try the next one */
attr_type = NULL;
+#ifdef DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES
if (attr_index >= 0) {
attr_type = attrs[attr_index++];
} else {
+#endif /* DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES */
rv = slapi_entry_next_attr ( e, currAttr, &nextAttr );
if ( rv != 0 ) break;
currAttr = nextAttr;
@@ -1093,7 +1101,9 @@ acl_read_access_allowed_on_entry (
}
/* Get the attr type */
if ( currAttr ) slapi_attr_get_type ( currAttr , &attr_type );
+#ifdef DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES
}
+#endif /* DETERMINE_ACCESS_BASED_ON_REQUESTED_ATTRIBUTES */
}
}
commit e936bd91f910825918b6b2951add7bc37c1a814b
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 14:08:26 2011 -0600
Bug 691422 - cl5DeleteRUV - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: cl5DeleteRUV - fix coverity control flow issues
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: move the if (file_obj) clause after the bail: label - I think this
was the intention of the code - if the while loop was bailed, file_obj may be
acquired, so it would have to be released
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/cl5_api.c
b/ldap/servers/plugins/replication/cl5_api.c
index 88085e1..6f75d7f 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -6401,10 +6401,10 @@ cl5DeleteRUV()
}
file_obj = objset_next_obj(s_cl5Desc.dbFiles, file_obj);
}
+bail:
if (file_obj) {
object_release (file_obj);
}
-bail:
if (closeit && (CL5_STATE_OPEN == s_cl5Desc.dbState)) {
_cl5Close ();
s_cl5Desc.dbState = CL5_STATE_CLOSED; /* force to change the state */
commit be6ee97e7ee238fc03aea74ab3e5e37537fc6e13
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 13:57:53 2011 -0600
Bug 691422 - SetUnicodeStringFromUTF_8 - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: SetUnicodeStringFromUTF_8 - fix coverity control flow issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: n is size_t, which is unsigned. In this case, n cannot be less
than zero anyway, so comparison with 0 will suffice.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/collation/collate.c
b/ldap/servers/plugins/collation/collate.c
index be2e372..240da70 100644
--- a/ldap/servers/plugins/collation/collate.c
+++ b/ldap/servers/plugins/collation/collate.c
@@ -278,7 +278,7 @@ SetUnicodeStringFromUTF_8 (UChar** U, int32_t* Ulen, int *isAlloced,
const struc
}
/* end now points at last non-null/non-space of val */
- if (n < 0) { /* bogus */
+ if (n == 0) { /* bogus */
return U_INVALID_FORMAT_ERROR; /* don't know what else to use here */
}
commit 1f23a16771a75b958850220c166af373e32457d8
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 12:39:05 2011 -0600
Bug 691422 - csnplFree - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: csnplFree - fix coverity control flow issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: remove spurious semicolon
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/csnpl.c
b/ldap/servers/plugins/replication/csnpl.c
index 0f0d24b..048c6a3 100644
--- a/ldap/servers/plugins/replication/csnpl.c
+++ b/ldap/servers/plugins/replication/csnpl.c
@@ -122,7 +122,7 @@ void csnplFree (CSNPL **csnpl)
/* free all remaining nodes */
llistDestroy (&((*csnpl)->csnList), (FNFree)csnpldata_free);
- if ((*csnpl)->csnLock);
+ if ((*csnpl)->csnLock)
PR_DestroyRWLock ((*csnpl)->csnLock);
slapi_ch_free ((void**)csnpl);
commit 5ab6c376a9339aef68c492f8bcf657b28a662a22
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 12:33:58 2011 -0600
Bug 691422 - ldbm_back_upgradedb - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: ldbm_back_upgradedb - fix coverity control flow issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: remove spurious semicolon
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index cf0f539..87048c9 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -2760,7 +2760,7 @@ int ldbm_back_upgradedb(Slapi_PBlock *pb)
else
{
rval = dblayer_delete_indices(inst);
- if (rval);
+ if (rval)
{
upgrade_rval += rval;
slapi_log_error(SLAPI_LOG_FATAL, "upgrade DB",
commit 45189c533b46292bcea0adcfba457d292ef23a3d
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Mar 28 12:32:28 2011 -0600
Bug 691422 - sdt_destroy - fix coverity control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=691422
Resolves: bug 691422
Bug Description: sdt_destroy - fix coverity control flow issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: remove spurious semicolons
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/tools/rsearch/sdattable.c
b/ldap/servers/slapd/tools/rsearch/sdattable.c
index 126ddc3..df1c152 100644
--- a/ldap/servers/slapd/tools/rsearch/sdattable.c
+++ b/ldap/servers/slapd/tools/rsearch/sdattable.c
@@ -96,9 +96,9 @@ void sdt_destroy(SDatTable *sdt)
free(sdt->uids[i]);
}
}
- if (sdt->dns);
+ if (sdt->dns)
free(sdt->dns);
- if (sdt->uids);
+ if (sdt->uids)
free(sdt->uids);
free(sdt);
}