[Fedora-directory-commits] ldapserver/ldap/servers/plugins/cos cos_cache.c, 1.11, 1.12

Richard Allen Megginson rmeggins at fedoraproject.org
Thu Feb 26 22:38:59 UTC 2009


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/cos
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4361

Modified Files:
	cos_cache.c 
Log Message:
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.



Index: cos_cache.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/cos/cos_cache.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- cos_cache.c	16 Feb 2009 17:26:57 -0000	1.11
+++ cos_cache.c	26 Feb 2009 22:38:57 -0000	1.12
@@ -2517,12 +2517,13 @@
 	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;




More information about the Fedora-directory-commits mailing list