Fix OpenLDAP ITS#3782 - broken logic in bitwise matching rules

This commit is contained in:
Luke Howard 2005-06-16 05:31:24 +00:00
parent b6aa697000
commit f90800667d

View File

@ -2321,7 +2321,7 @@ integerBitAndMatch(
return LDAP_CONSTRAINT_VIOLATION; return LDAP_CONSTRAINT_VIOLATION;
} }
*matchp = (lValue & lAssertedValue) ? 0 : 1; *matchp = ((lValue & lAssertedValue) == lAssertedValue) ? 0 : 1;
return LDAP_SUCCESS; return LDAP_SUCCESS;
} }
@ -2352,7 +2352,7 @@ integerBitOrMatch(
return LDAP_CONSTRAINT_VIOLATION; return LDAP_CONSTRAINT_VIOLATION;
} }
*matchp = (lValue | lAssertedValue) ? 0 : -1; *matchp = ((lValue & lAssertedValue) != 0) ? 0 : -1;
return LDAP_SUCCESS; return LDAP_SUCCESS;
} }