diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-06-21 14:41:02 +1200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-07-24 11:41:53 +0200 |
commit | a68553792a8512a2d266bbb86f064f78b5482a65 (patch) | |
tree | 2a0264bf1b9a67f1eb146eb55e4eb3006e78b99b | |
parent | 51cbeff886fe01db463448f8655a43d10040dc8b (diff) | |
download | samba-a68553792a8512a2d266bbb86f064f78b5482a65.tar.gz |
CVE-2022-32746 s4/dsdb/partition: Fix LDB flags comparison
LDB_FLAG_MOD_* values are not actually flags, and the previous
comparison was equivalent to
(req_msg->elements[el_idx].flags & LDB_FLAG_MOD_MASK) != 0
which is true whenever any 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>
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/partition.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 2544a106d13..2d90ca5d1b3 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -493,8 +493,8 @@ static int partition_copy_all_callback_action( * them here too */ for (el_idx=0; el_idx < req_msg->num_elements; el_idx++) { - if (req_msg->elements[el_idx].flags & LDB_FLAG_MOD_DELETE - || ((req_msg->elements[el_idx].flags & LDB_FLAG_MOD_REPLACE) && + if (LDB_FLAG_MOD_TYPE(req_msg->elements[el_idx].flags) == LDB_FLAG_MOD_DELETE + || ((LDB_FLAG_MOD_TYPE(req_msg->elements[el_idx].flags) == LDB_FLAG_MOD_REPLACE) && req_msg->elements[el_idx].num_values == 0)) { if (ldb_msg_find_element(modify_msg, req_msg->elements[el_idx].name) != NULL) { |