]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2020-25722 samdb: Fill in isCriticalSystemObject on any account type change
authorAndrew Bartlett <abartlet@samba.org>
Thu, 21 Oct 2021 00:02:42 +0000 (13:02 +1300)
committerJule Anger <janger@samba.org>
Mon, 8 Nov 2021 09:52:10 +0000 (10:52 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14753

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
selftest/knownfail.d/sam-isCriticalSystemObject [deleted file]
source4/dsdb/samdb/ldb_modules/samldb.c

diff --git a/selftest/knownfail.d/sam-isCriticalSystemObject b/selftest/knownfail.d/sam-isCriticalSystemObject
deleted file mode 100644 (file)
index a6351a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba4.sam.python\(.*\).__main__.SamTests.test_isCriticalSystemObject_user
\ No newline at end of file
index aeef663d2f0c228e9135bd52ed5895974eb5bf17..5352af1099f77586818e8ace59c5513e051a1d1c 100644 (file)
@@ -2621,8 +2621,14 @@ static int samldb_user_account_control_change(struct samldb_ctx *ac)
                el->flags = LDB_FLAG_MOD_REPLACE;
        }
 
-       /* "isCriticalSystemObject" might be set/changed */
-       if (old_is_critical != new_is_critical) {
+       /*
+        * "isCriticalSystemObject" might be set/changed
+        *
+        * Even a change from UF_NORMAL_ACCOUNT (implicitly FALSE) to
+        * UF_WORKSTATION_TRUST_ACCOUNT (actually FALSE) triggers
+        * creating the attribute.
+        */
+       if (old_is_critical != new_is_critical || old_atype != new_atype) {
                ret = ldb_msg_add_string(ac->msg, "isCriticalSystemObject",
                                         new_is_critical ? "TRUE": "FALSE");
                if (ret != LDB_SUCCESS) {