]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2020-25722 s4/dsdb/samldb: samldb_group_type_change() checks all values
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 20 Oct 2021 04:17:50 +0000 (17:17 +1300)
committerJule Anger <janger@samba.org>
Mon, 8 Nov 2021 09:52:11 +0000 (10:52 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14876

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/samldb.c

index 48eb88f728bfa04135603d80d726e15ec4dacc71..391437d759d426bf4817050d07b873f4fab1a10f 100644 (file)
@@ -3221,8 +3221,15 @@ static int samldb_group_type_change(struct samldb_ctx *ac)
        struct ldb_result *res;
        const char * const attrs[] = { "groupType", NULL };
 
-       el = dsdb_get_single_valued_attr(ac->msg, "groupType",
-                                        ac->req->operation);
+       ret = dsdb_get_expected_new_values(ac,
+                                          ac->msg,
+                                          "groupType",
+                                          &el,
+                                          ac->req->operation);
+       if (ret != LDB_SUCCESS) {
+               return ret;
+       }
+
        if (el == NULL) {
                /* we are not affected */
                return LDB_SUCCESS;