From: Joseph Sutton Date: Tue, 14 Jun 2022 09:11:33 +0000 (+1200) Subject: CVE-2022-32746 s4/dsdb/tombstone_reanimate: Use LDB_FLAG_MOD_TYPE() for flags equalit... X-Git-Tag: samba-4.14.14~93 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=bedd0b768c3f92645af033399aefd7ee971d9150;p=samba.git CVE-2022-32746 s4/dsdb/tombstone_reanimate: 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 --- diff --git a/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c b/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c index 64e05195798..5f8911c66be 100644 --- a/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c +++ b/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c @@ -104,7 +104,7 @@ static bool is_tombstone_reanimate_request(struct ldb_request *req, if (el_dn == NULL) { return false; } - if (el_dn->flags != LDB_FLAG_MOD_REPLACE) { + if (LDB_FLAG_MOD_TYPE(el_dn->flags) != LDB_FLAG_MOD_REPLACE) { return false; } if (el_dn->num_values != 1) { @@ -117,7 +117,7 @@ static bool is_tombstone_reanimate_request(struct ldb_request *req, return false; } - if (el_deleted->flags != LDB_FLAG_MOD_DELETE) { + if (LDB_FLAG_MOD_TYPE(el_deleted->flags) != LDB_FLAG_MOD_DELETE) { return false; }