]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2020-25722 s4/dsdb/samldb: samldb_user_account_control_change() checks all values
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 20 Oct 2021 04:15:00 +0000 (17:15 +1300)
committerJule Anger <janger@samba.org>
Mon, 8 Nov 2021 09:52:11 +0000 (10:52 +0100)
There is another call to dsdb_get_expected_new_values() in this function
that we change in the next commit.

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 ba56cf8826ef6b7c120f54afab44adaff90b97c1..b84ef4c26d5efd04e16b3db752f1654e7b694a41 100644 (file)
@@ -2807,8 +2807,15 @@ static int samldb_user_account_control_change(struct samldb_ctx *ac)
        bool old_is_critical = false;
        bool new_is_critical = false;
 
-       el = dsdb_get_single_valued_attr(ac->msg, "userAccountControl",
-                                        ac->req->operation);
+       ret = dsdb_get_expected_new_values(ac,
+                                          ac->msg,
+                                          "userAccountControl",
+                                          &el,
+                                          ac->req->operation);
+       if (ret != LDB_SUCCESS) {
+               return ret;
+       }
+
        if (el == NULL || el->num_values == 0) {
                ldb_asprintf_errstring(ldb,
                        "%08X: samldb: 'userAccountControl' can't be deleted!",