summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2009-02-26 22:38:57 +0000
committerRich Megginson <rmeggins@redhat.com>2009-02-26 22:38:57 +0000
commit489e3dd14c62e55fd26135a676f66dbe0627ecaf (patch)
tree66e4495071b9c31fb17b545823917ee4198f8ce5
parent4124d830d825c7588029b6644afe8cbac0db9ad8 (diff)
downloadds-489e3dd14c62e55fd26135a676f66dbe0627ecaf.tar.gz
ds-489e3dd14c62e55fd26135a676f66dbe0627ecaf.tar.xz
ds-489e3dd14c62e55fd26135a676f66dbe0627ecaf.zip
Resolves: bug 486495
Description: CoS operational qualifier doesn't work Reviewed by: rmeggins Fix Description: If not using the default, the processing for that case was skipped due to the incorrect if test for pDefAttr. The fix is to move the test for pDefAttr into the lower condition, to make sure it is value before dereferencing it to check for attr_operational or attr_operational_default. The attr_operational || attr_operational_default test has been moved into the using_default && pDefAttr condition, and into the !using_default && pCache condition for the non default case. Parentheses have been added for readability.
-rw-r--r--ldap/servers/plugins/cos/cos_cache.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index b62e63b1..e46e0ab3 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -2517,12 +2517,13 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, Sl
if(props)
*props = 0;
- if(hit == 1 && props && pDefAttr) {
+ if(hit == 1 && props) {
if (
- ((using_default && pDefAttr->attr_operational == 1) ||
- (!using_default && pCache->ppAttrIndex[attr_matched_index]->attr_operational == 1)) ||
- ((using_default && pDefAttr->attr_operational_default == 1) ||
- (!using_default && pCache->ppAttrIndex[attr_matched_index]->attr_operational_default == 1)) )
+ (using_default && pDefAttr &&
+ ((pDefAttr->attr_operational == 1) || (pDefAttr->attr_operational_default == 1))) ||
+ (!using_default && pCache && pCache->ppAttrIndex && pCache->ppAttrIndex[attr_matched_index] &&
+ ((pCache->ppAttrIndex[attr_matched_index]->attr_operational == 1) ||
+ (pCache->ppAttrIndex[attr_matched_index]->attr_operational_default == 1))))
{
/* this is an operational attribute, lets mark it so */
*props |= SLAPI_ATTR_FLAG_OPATTR;