From 7f171a9e0f9b5945bd16a1330ba0908090659030 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 9 Nov 2010 14:39:30 +0100 Subject: s4:password_hash and acl LDB modules - handle the "userPassword" attribute according to the "dSHeuristics" --- source4/dsdb/samdb/ldb_modules/util.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source4/dsdb/samdb/ldb_modules/util.c') diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 123f03f15d..01d7347d3e 100644 --- a/source4/dsdb/samdb/ldb_modules/util.c +++ b/source4/dsdb/samdb/ldb_modules/util.c @@ -1099,6 +1099,26 @@ bool dsdb_block_anonymous_ops(struct ldb_module *module, return result; } +bool dsdb_user_password_support(struct ldb_module *module, + TALLOC_CTX *mem_ctx) +{ + TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); + bool result; + const struct ldb_val *hr_val = dsdb_module_find_dsheuristics(module, + tmp_ctx); + if (hr_val == NULL || hr_val->length < DS_HR_USER_PASSWORD_SUPPORT) { + result = false; + } else if ((hr_val->data[DS_HR_USER_PASSWORD_SUPPORT -1] == '2') || + (hr_val->data[DS_HR_USER_PASSWORD_SUPPORT -1] == '0')) { + result = false; + } else { + result = true; + } + + talloc_free(tmp_ctx); + return result; +} + /* show the chain of requests, useful for debugging async requests */ -- cgit