svn commit: samba r6934 - in branches/SAMBA_4_0/source/lib/ldb/modules: .

idra at samba.org idra at samba.org
Sun May 22 10:27:52 GMT 2005


Author: idra
Date: 2005-05-22 10:27:51 +0000 (Sun, 22 May 2005)
New Revision: 6934

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6934

Log:
thanks to HotaruT for pointing out skel.c was not in line with the rest of the code
Modified:
   branches/SAMBA_4_0/source/lib/ldb/modules/skel.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/modules/skel.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/modules/skel.c	2005-05-22 10:23:01 UTC (rev 6933)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/skel.c	2005-05-22 10:27:51 UTC (rev 6934)
@@ -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 @@
 }
 
 /* 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 @@
 	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;



More information about the samba-cvs mailing list