diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-09 14:39:30 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-11 10:03:39 +0100 |
commit | 7f171a9e0f9b5945bd16a1330ba0908090659030 (patch) | |
tree | 62975515164f0d4b59697cbac90389eaa60fb9d9 /source4/dsdb/samdb/ldb_modules/util.c | |
parent | d6c78fbd3a88e9fc7b625a03d163e9b5098b94d6 (diff) | |
download | samba-7f171a9e0f9b5945bd16a1330ba0908090659030.tar.gz |
s4:password_hash and acl LDB modules - handle the "userPassword" attribute according to the "dSHeuristics"
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/util.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/util.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 123f03f15d5..01d7347d3eb 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 */ |