From: Stefan Metzmacher Date: Tue, 6 Oct 2020 09:21:34 +0000 (+0200) Subject: s4:dsdb:util: add dsdb_do_list_object() helper X-Git-Tag: samba-4.12.10~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66e64bf9a61525bd3b0eee111a9860349841fa6a;p=thirdparty%2Fsamba.git s4:dsdb:util: add dsdb_do_list_object() helper BUG: https://bugzilla.samba.org/show_bug.cgi?id=14531 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall (cherry picked from commit ffc0bdc6d49e88da1ee408956365da163ff3e1b2) --- diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 20c854f0b9a..9519ecfa928 100644 --- a/source4/dsdb/samdb/ldb_modules/util.c +++ b/source4/dsdb/samdb/ldb_modules/util.c @@ -1410,6 +1410,27 @@ bool dsdb_user_password_support(struct ldb_module *module, return result; } +bool dsdb_do_list_object(struct ldb_module *module, + TALLOC_CTX *mem_ctx, + struct ldb_request *parent) +{ + TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); + bool result; + const struct ldb_val *hr_val = dsdb_module_find_dsheuristics(module, + tmp_ctx, + parent); + if (hr_val == NULL || hr_val->length < DS_HR_DOLISTOBJECT) { + result = false; + } else if (hr_val->data[DS_HR_DOLISTOBJECT -1] == '1') { + result = true; + } else { + result = false; + } + + talloc_free(tmp_ctx); + return result; +} + /* show the chain of requests, useful for debugging async requests */