]> git.sur5r.net Git - openldap/commitdiff
Fix OpenLDAP ITS#3782 - broken logic in bitwise matching rules
authorLuke Howard <lukeh@openldap.org>
Thu, 16 Jun 2005 05:31:24 +0000 (05:31 +0000)
committerLuke Howard <lukeh@openldap.org>
Thu, 16 Jun 2005 05:31:24 +0000 (05:31 +0000)
servers/slapd/schema_init.c

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