summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-13 16:32:50 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-13 18:37:20 +0200
commited68189c5f6c39d075d4c08a92994acf5e5a9a51 (patch)
tree2fe1dbd74bfa90dfbd845643e11799a75e78b881 /source4/dsdb/samdb/ldb_modules
parent18ea6c5dce8be836cb92b5b884cf6abac4a0f857 (diff)
downloadsamba-ed68189c5f6c39d075d4c08a92994acf5e5a9a51.tar.gz
samba-ed68189c5f6c39d075d4c08a92994acf5e5a9a51.tar.bz2
samba-ed68189c5f6c39d075d4c08a92994acf5e5a9a51.zip
s4:samldb LDB module - proof the account type also on LDB modify operations
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index f35a56a5f5..c31e1ad4bf 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -1346,6 +1346,10 @@ static int samldb_modify(struct ldb_module *module, struct ldb_request *req)
}
account_type = ds_gtype2atype(group_type);
+ if (account_type == 0) {
+ ldb_set_errstring(ldb, "samldb: Unrecognized account type!");
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
ret = samdb_msg_add_uint(ldb, ac->msg, ac->msg,
"sAMAccountType",
account_type);
@@ -1383,6 +1387,10 @@ static int samldb_modify(struct ldb_module *module, struct ldb_request *req)
user_account_control = strtoul((const char *)el->values[0].data,
NULL, 0);
account_type = ds_uf2atype(user_account_control);
+ if (account_type == 0) {
+ ldb_set_errstring(ldb, "samldb: Unrecognized account type!");
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
ret = samdb_msg_add_uint(ldb, ac->msg, ac->msg,
"sAMAccountType",
account_type);