summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-05-22 10:27:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:58 -0500
commit3d97821243b0d4af866ccc158e0134a49c0e4901 (patch)
tree5c54ee528fec61ad824878aafb28397abea226ec /source4/lib
parent2b7fe67f4d02f861c9a4bfe823e648f0a995e613 (diff)
downloadsamba-3d97821243b0d4af866ccc158e0134a49c0e4901.tar.gz
samba-3d97821243b0d4af866ccc158e0134a49c0e4901.tar.bz2
samba-3d97821243b0d4af866ccc158e0134a49c0e4901.zip
r6934: thanks to HotaruT for pointing out skel.c was not in line with the rest of the code
(This used to be commit 9f0963c97f94687a1226d224f80b2aac1128d1a0)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/modules/skel.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c
index 09f2452365..33e5d53cef 100644
--- a/source4/lib/ldb/modules/skel.c
+++ b/source4/lib/ldb/modules/skel.c
@@ -36,6 +36,10 @@
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_private.h"
+static struct private_data {
+ const char *error_string;
+};
+
/* search */
static int skel_search(struct ldb_module *module, const char *base,
enum ldb_scope scope, const char *expression,
@@ -69,13 +73,13 @@ static int skel_rename_record(struct ldb_module *module, const char *olddn, cons
}
/* named_lock */
-static const char *skel_named_lock(struct ldb_module *module, const char *lockname)
+static int skel_named_lock(struct ldb_module *module, const char *lockname)
{
return ldb_next_named_lock(module, lockname);
}
/* named_unlock */
-static const char *skel_named_unlock(struct ldb_module *module, const char *lockname)
+static int skel_named_unlock(struct ldb_module *module, const char *lockname)
{
return ldb_next_named_unlock(module, lockname);
}
@@ -105,18 +109,28 @@ static const struct ldb_module_ops skel_ops = {
skel_errstring
};
-#ifdef HAVE_DLOPEN
- struct ldb_module *init_module(struct ldb_context *ldb, const char *options[])
+#ifdef HAVE_DLOPEN_DISABLED
+struct ldb_module *init_module(struct ldb_context *ldb, const char *options[])
#else
-struct ldb_module *skel_plugin_init(struct ldb_context *ldb, const char *options[])
+struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options[])
#endif
{
struct ldb_module *ctx;
+ struct private_data *data;
- ctx = (struct ldb_module *)malloc(sizeof(struct ldb_module));
+ ctx = talloc(ldb, struct ldb_module);
if (!ctx)
return NULL;
+ data = talloc(ctx, struct private_data);
+ if (data == NULL) {
+ talloc_free(ctx);
+ return NULL;
+ }
+
+ data->error_string = NULL;
+ ctx->private_data = data;
+
ctx->ldb = ldb;
ctx->prev = ctx->next = NULL;
ctx->private_data = NULL;