From a599edf04cbdeef9014923ba0d3713b8ff84f266 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Oct 2005 06:10:23 +0000 Subject: r10913: This patch isn't as big as it looks ... most of the changes are fixes to make all the ldb code compile without warnings on gcc4. Unfortunately That required a lot of casts :-( I have also added the start of an 'operational' module, which will replace the timestamp module, plus add support for some other operational attributes In ldb_msg_*() I added some new utility functions to make the operational module sane, and remove the 'ldb' argument from the ldb_msg_add_*() functions. That argument was only needed back in the early days of ldb when we didn't use the hierarchical talloc and thus needed a place to get the allocation function from. Now its just a pain to pass around everywhere. Also added a ldb_debug_set() function that calls ldb_debug() plus sets the result using ldb_set_errstring(). That saves on some awkward coding in a few places. (This used to be commit f6818daecca95760c12f79fd307770cbe3346f57) --- source4/lib/registry/reg_backend_ldb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/lib/registry/reg_backend_ldb.c') diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c index 469961dfb4..108dd01a6b 100644 --- a/source4/lib/registry/reg_backend_ldb.c +++ b/source4/lib/registry/reg_backend_ldb.c @@ -70,25 +70,25 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx, TALLOC_CT struct ldb_message *msg = talloc_zero(mem_ctx, struct ldb_message); char *type_s; - ldb_msg_add_string(ctx, msg, "value", talloc_strdup(mem_ctx, name)); + ldb_msg_add_string(msg, "value", talloc_strdup(mem_ctx, name)); switch (type) { case REG_SZ: case REG_EXPAND_SZ: val.length = convert_string_talloc(mem_ctx, CH_UTF16, CH_UTF8, (void *)data.data, data.length, (void **)&val.data); - ldb_msg_add_value(ctx, msg, "data", &val); + ldb_msg_add_value(msg, "data", &val); break; case REG_DWORD: - ldb_msg_add_string(ctx, msg, "data", talloc_asprintf(mem_ctx, "0x%x", IVAL(data.data, 0))); + ldb_msg_add_string(msg, "data", talloc_asprintf(mem_ctx, "0x%x", IVAL(data.data, 0))); break; default: - ldb_msg_add_value(ctx, msg, "data", &data); + ldb_msg_add_value(msg, "data", &data); } type_s = talloc_asprintf(mem_ctx, "%u", type); - ldb_msg_add_string(ctx, msg, "type", type_s); + ldb_msg_add_string(msg, "type", type_s); return msg; } @@ -276,7 +276,7 @@ static WERROR ldb_add_key (TALLOC_CTX *mem_ctx, const struct registry_key *paren msg->dn = reg_path_to_ldb(msg, parent, name, NULL); - ldb_msg_add_string(ctx, msg, "key", talloc_strdup(mem_ctx, name)); + ldb_msg_add_string(msg, "key", talloc_strdup(mem_ctx, name)); ret = ldb_add(ctx, msg); if (ret < 0) { -- cgit