diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-06-14 21:12:39 +1200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-07-24 11:41:53 +0200 |
commit | 49dd9042f4ee380fa1dafcebcb54d0e1f0852463 (patch) | |
tree | 21aa054107b6b065258ff2aed35c468230769ac4 | |
parent | bedd0b768c3f92645af033399aefd7ee971d9150 (diff) | |
download | samba-49dd9042f4ee380fa1dafcebcb54d0e1f0852463.tar.gz |
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>
-rw-r--r-- | source4/lib/registry/ldb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index e089355975b..db383a560da 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -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; } } |