1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00

CVE-2022-32746 s4:torture: Fix LDB flags comparison

LDB_FLAG_MOD_* values are not actually flags, and the previous
comparison was equivalent to

(el->flags & LDB_FLAG_MOD_MASK) == 0

which is only true if none of the LDB_FLAG_MOD_* values are set. Correct
the expression to what it was probably intended to be.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
This commit is contained in:
Joseph Sutton 2022-06-21 14:49:51 +12:00 committed by Jule Anger
parent a68553792a
commit 582ac17136

View File

@ -527,7 +527,9 @@ static bool test_analyse_objects(struct torture_context *tctx,
el = &new_msg->elements[idx];
a = dsdb_attribute_by_lDAPDisplayName(ldap_schema,
el->name);
if (!(el->flags & (LDB_FLAG_MOD_ADD|LDB_FLAG_MOD_REPLACE))) {
if (LDB_FLAG_MOD_TYPE(el->flags) != LDB_FLAG_MOD_ADD &&
LDB_FLAG_MOD_TYPE(el->flags) != LDB_FLAG_MOD_REPLACE)
{
/* DRS only value */
is_warning = false;
} else if (a->linkID & 1) {