summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2015-01-06 16:43:37 +1300
committerAndrew Bartlett <abartlet@samba.org>2015-01-22 07:50:06 +0100
commit49485ab9782b7abc32581f29c35d862bb9a7058c (patch)
treec6442b2304d98bd9ea59242479584fbc6173a231 /source4/dsdb/samdb/ldb_modules
parentad98c0e1755e3fdc6efd8551590c1781b318a04f (diff)
downloadsamba-49485ab9782b7abc32581f29c35d862bb9a7058c.tar.gz
samba-49485ab9782b7abc32581f29c35d862bb9a7058c.tar.xz
samba-49485ab9782b7abc32581f29c35d862bb9a7058c.zip
dsdb-samldb: Only allow known and settable userAccountControl bits to be set
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10993 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 8c93c6d58b..f89e6814af 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -1825,12 +1825,17 @@ static int samldb_user_account_control_change(struct samldb_ctx *ac)
new_acb = samdb_result_acct_flags(tmp_msg, NULL);
talloc_free(tmp_msg);
/*
- * UF_LOCKOUT and UF_PASSWORD_EXPIRED are only generated
- * and not stored. We ignore them almost completely.
+ * UF_LOCKOUT, UF_PASSWD_CANT_CHANGE and UF_PASSWORD_EXPIRED
+ * are only generated and not stored. We ignore them almost
+ * completely, along with unknown bits and UF_SCRIPT.
*
- * The only exception is the resulting ACB_AUTOLOCK in clear_acb.
+ * The only exception is ACB_AUTOLOCK, which features in
+ * clear_acb when the bit is cleared in this modify operation.
+ *
+ * MS-SAMR 2.2.1.13 UF_FLAG Codes states that some bits are
+ * ignored by clients and servers
*/
- new_uac = raw_uac & ~(UF_LOCKOUT|UF_PASSWORD_EXPIRED);
+ new_uac = raw_uac & UF_SETTABLE_BITS;
/* Fetch the old "userAccountControl" and "objectClass" */
ret = dsdb_module_search_dn(ac->module, ac, &res, ac->msg->dn, attrs,