CVE-2022-32746 s4/dsdb/tombstone_reanimate: Use LDB_FLAG_MOD_TYPE() for flags equalit...
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 14 Jun 2022 09:11:33 +0000 (21:11 +1200)
committerJule Anger <janger@samba.org>
Sun, 24 Jul 2022 09:41:53 +0000 (11:41 +0200)
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>
source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c

index 64e05195798f11b79a03579e473276a44a001438..5f8911c66be8e05529d9d75b42ba3964abcfc09a 100644 (file)
@@ -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;
        }