]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2022-32746 ldb:rdn_name: Use LDB_FLAG_MOD_TYPE() for flags equality check
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 15 Feb 2022 23:43:52 +0000 (12:43 +1300)
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>
lib/ldb/modules/rdn_name.c

index e69ad9315aece96bc4df126493416c9914918b4c..25cffe07591af1c741cbc13b88ef155b6b94f307 100644 (file)
@@ -545,7 +545,7 @@ static int rdn_name_modify(struct ldb_module *module, struct ldb_request *req)
        if (e != NULL) {
                ldb_asprintf_errstring(ldb, "Modify of 'distinguishedName' on %s not permitted, must use 'rename' operation instead",
                                       ldb_dn_get_linearized(req->op.mod.message->dn));
-               if (e->flags == LDB_FLAG_MOD_REPLACE) {
+               if (LDB_FLAG_MOD_TYPE(e->flags) == LDB_FLAG_MOD_REPLACE) {
                        return LDB_ERR_CONSTRAINT_VIOLATION;
                } else {
                        return LDB_ERR_UNWILLING_TO_PERFORM;