summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-05-23 06:49:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:59 -0500
commit4f4b92a6904210a467282a997e81a4e8ab1f415a (patch)
tree9d3d70c11feead7f51022722b5a671893b37225e /source4/lib/ldb/modules
parentd4a7543bad26b6b771e189b3084745a60fe985f0 (diff)
downloadsamba-4f4b92a6904210a467282a997e81a4e8ab1f415a.tar.gz
samba-4f4b92a6904210a467282a997e81a4e8ab1f415a.tar.bz2
samba-4f4b92a6904210a467282a997e81a4e8ab1f415a.zip
r6937: some minor fixes and updates
metze (This used to be commit 03b1ff48f97fa81c515f90a398c6f8cde579cb51)
Diffstat (limited to 'source4/lib/ldb/modules')
-rw-r--r--source4/lib/ldb/modules/skel.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c
index 9fb01941c9..505b19a288 100644
--- a/source4/lib/ldb/modules/skel.c
+++ b/source4/lib/ldb/modules/skel.c
@@ -36,9 +36,9 @@
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_private.h"
-const struct private_data {
+struct private_data {
- const char *error_string;
+ char *errstring;
};
/* search */
@@ -93,21 +93,23 @@ static const char *skel_errstring(struct ldb_module *module)
static int skel_destructor(void *module_ctx)
{
- struct ldb_module *ctx = module_ctx;
+ struct ldb_module *ctx = talloc_get_type(module_ctx, struct ldb_module);
+ struct private_data *data = talloc_get_type(ctx->private_data, struct private_data);
/* put your clean-up functions here */
+ if (data->errstring) talloc_free(data->errstring);
return 0;
}
static const struct ldb_module_ops skel_ops = {
- "skel",
- skel_search,
- skel_add_record,
- skel_modify_record,
- skel_delete_record,
- skel_rename_record,
- skel_named_lock,
- skel_named_unlock,
- skel_errstring
+ .name = "skel",
+ .search = skel_search,
+ .add_record = skel_add_record,
+ .modify_record = skel_modify_record,
+ .delete_record = skel_delete_record,
+ .rename_record = skel_rename_record,
+ .named_lock = skel_named_lock,
+ .named_unlock = skel_named_unlock,
+ .errstring = skel_errstring
};
#ifdef HAVE_DLOPEN_DISABLED
@@ -129,7 +131,7 @@ struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options
return NULL;
}
- data->error_string = NULL;
+ data->errstring = NULL;
ctx->private_data = data;
ctx->ldb = ldb;