1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

CVE-2022-32746 s4/registry: Use LDB_FLAG_MOD_TYPE() for flags equality check

Now unrelated flags will no longer affect the result.

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-14 21:12:39 +12:00 committed by Jule Anger
parent 738955d0e1
commit 77d8711774

View File

@ -859,7 +859,7 @@ static WERROR ldb_set_value(struct hive_key *parent,
/* Try first a "modify" and if this doesn't work do try an "add" */
for (i = 0; i < msg->num_elements; i++) {
if (msg->elements[i].flags != LDB_FLAG_MOD_DELETE) {
if (LDB_FLAG_MOD_TYPE(msg->elements[i].flags) != LDB_FLAG_MOD_DELETE) {
msg->elements[i].flags = LDB_FLAG_MOD_REPLACE;
}
}