From 79ebe463e2aed9125c9086f6bff99adeef5e4b88 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 15 Nov 2004 11:42:17 +0000 Subject: r3755: add missing files (This used to be commit 0b715b6ce21d23970d207d57e90133be17790d15) --- source4/lib/ldb/modules/skel.c | 123 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 source4/lib/ldb/modules/skel.c (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c new file mode 100644 index 0000000000..1d6314ee74 --- /dev/null +++ b/source4/lib/ldb/modules/skel.c @@ -0,0 +1,123 @@ +/* + ldb database library + + Copyright (C) Simo Sorce 2004 + + ** NOTE! The following LGPL license applies to the ldb + ** library. This does NOT imply that all of Samba is released + ** under the LGPL + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + * Name: ldb + * + * Component: ldb skel module + * + * Description: example module + * + * Author: Simo Sorce + */ + +#include "includes.h" + +/* close */ +static int skel_close(struct ldb_module *module) +{ + return ldb_next_close(module); +} + +/* search */ +static int skel_search(struct ldb_module *module, const char *base, + enum ldb_scope scope, const char *expression, + const char * const *attrs, struct ldb_message ***res) +{ + return ldb_next_search(module, base, scope, expression, attrs, res); +} + +/* search_free */ +static int skel_search_free(struct ldb_module *module, struct ldb_message **res) +{ + return ldb_next_search_free(module, res); +} + +/* add_record */ +static int skel_add_record(struct ldb_module *module, const struct ldb_message *msg) +{ + return ldb_next_add_record(module, msg); +} + +/* modify_record */ +static int skel_modify_record(struct ldb_module *module, const struct ldb_message *msg) +{ + return ldb_next_modify_record(module, msg); +} + +/* delete_record */ +static int skel_delete_record(struct ldb_module *module, const char *dn) +{ + return ldb_next_delete_record(module, dn); +} + +/* rename_record */ +static int skel_rename_record(struct ldb_module *module, const char *olddn, const char *newdn) +{ + return ldb_next_rename_record(module, olddn, newdn); +} + +/* return extended error information */ +static const char *skel_errstring(struct ldb_module *module) +{ + return ldb_next_errstring(module); +} + +static void skel_cache_free(struct ldb_module *module) +{ + ldb_next_cache_free(module); +} + +static const struct ldb_module_ops skel_ops = { + "skel", + skel_close, + skel_search, + skel_search_free, + skel_add_record, + skel_modify_record, + skel_delete_record, + skel_rename_record, + skel_errstring, + skel_cache_free +}; + +#ifdef HAVE_DLOPEN + 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[]) +#endif +{ + struct ldb_module *ctx; + + ctx = (struct ldb_module *)malloc(sizeof(struct ldb_module)); + if (!ctx) + return NULL; + + ctx->ldb = ldb; + ctx->prev = ctx->next = NULL; + ctx->private_data = NULL; + ctx->ops = &skel_ops; + + return ctx; +} -- cgit From 8a18778286a16423d7d6e483fdb308a91e294efe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 16 Nov 2004 09:00:52 +0000 Subject: r3783: - don't use make proto for ldb anymore - split ldh.h out of samba's includes.h - make ldb_context and ldb_module private to the subsystem - use ltdb_ prefix for all ldb_tdb functions metze (This used to be commit f5ee40d6ce8224e280070975efc9911558fe675c) --- source4/lib/ldb/modules/skel.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 1d6314ee74..331a2de5e4 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -33,6 +33,8 @@ */ #include "includes.h" +#include "ldb/include/ldb.h" +#include "ldb/include/ldb_private.h" /* close */ static int skel_close(struct ldb_module *module) -- cgit From a4de8cd6a5a882a8d49fdb4b0e625ffdc6b401bb Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 21 Nov 2004 15:51:54 +0000 Subject: r3897: add a locking infrastructure (This used to be commit a99c0adb09e2bc77b876d23cb2d0711ccffd83ca) --- source4/lib/ldb/modules/skel.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 331a2de5e4..3581969c18 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -80,6 +80,18 @@ static int skel_rename_record(struct ldb_module *module, const char *olddn, cons return ldb_next_rename_record(module, olddn, newdn); } +/* named_lock */ +static const char *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) +{ + return ldb_next_named_unlock(module, lockname); +} + /* return extended error information */ static const char *skel_errstring(struct ldb_module *module) { @@ -100,6 +112,8 @@ static const struct ldb_module_ops skel_ops = { skel_modify_record, skel_delete_record, skel_rename_record, + skel_named_lock, + skel_named_unlock, skel_errstring, skel_cache_free }; -- cgit From 1a988ec9af7960616fb4661b20d86ff05146d836 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 2 Jan 2005 07:49:29 +0000 Subject: r4474: - converted ldb to use talloc internally - added gcov flags to Makefile.ldb - expanded ldb test suite to get more coverage (This used to be commit 0ab98f50a7e0fe15347a99e5c29a6590a87729a0) --- source4/lib/ldb/modules/skel.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 3581969c18..afafe1bbd9 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -98,11 +98,6 @@ static const char *skel_errstring(struct ldb_module *module) return ldb_next_errstring(module); } -static void skel_cache_free(struct ldb_module *module) -{ - ldb_next_cache_free(module); -} - static const struct ldb_module_ops skel_ops = { "skel", skel_close, @@ -114,8 +109,7 @@ static const struct ldb_module_ops skel_ops = { skel_rename_record, skel_named_lock, skel_named_unlock, - skel_errstring, - skel_cache_free + skel_errstring }; #ifdef HAVE_DLOPEN -- cgit From b1b14817eaa6e6579596d54166e17bc8d5605c01 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 27 Feb 2005 11:35:47 +0000 Subject: r5585: LDB interfaces change: changes: - ldb_wrap disappears from code and become a private structure of db_wrap.c thanks to our move to talloc in ldb code, we do not need to expose it anymore - removal of ldb_close() function form the code thanks to our move to talloc in ldb code, we do not need it anymore use talloc_free() to close and free an ldb database - some minor updates to ldb modules code to cope with the change and fix some bugs I found out during the process (This used to be commit d58be9e74b786a11a57e89df36081d55730dfe0a) --- source4/lib/ldb/modules/skel.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index afafe1bbd9..882a776819 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -36,12 +36,6 @@ #include "ldb/include/ldb.h" #include "ldb/include/ldb_private.h" -/* close */ -static int skel_close(struct ldb_module *module) -{ - return ldb_next_close(module); -} - /* search */ static int skel_search(struct ldb_module *module, const char *base, enum ldb_scope scope, const char *expression, @@ -98,9 +92,15 @@ static const char *skel_errstring(struct ldb_module *module) return ldb_next_errstring(module); } +static int skel_destructor(void *module_ctx) +{ + struct ldb_module *ctx = module_ctx; + /* put your clean-up functions here */ + return 0; +} + static const struct ldb_module_ops skel_ops = { "skel", - skel_close, skel_search, skel_search_free, skel_add_record, @@ -129,5 +129,7 @@ struct ldb_module *skel_plugin_init(struct ldb_context *ldb, const char *options ctx->private_data = NULL; ctx->ops = &skel_ops; + talloc_set_destructor (ctx, skel_destructor); + return ctx; } -- cgit From fe4d985b6f3d318d9b58a16677be3b4ae34fba15 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 25 Apr 2005 12:46:18 +0000 Subject: r6470: Remove ldb_search_free() it is not needed anymore. Just use talloc_free() to release the memory after an ldb_search(). (This used to be commit 4f0948dab0aa5e8b6a4ce486f3668ca8dfae23db) --- source4/lib/ldb/modules/skel.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 882a776819..09f2452365 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -44,12 +44,6 @@ static int skel_search(struct ldb_module *module, const char *base, return ldb_next_search(module, base, scope, expression, attrs, res); } -/* search_free */ -static int skel_search_free(struct ldb_module *module, struct ldb_message **res) -{ - return ldb_next_search_free(module, res); -} - /* add_record */ static int skel_add_record(struct ldb_module *module, const struct ldb_message *msg) { @@ -102,7 +96,6 @@ static int skel_destructor(void *module_ctx) static const struct ldb_module_ops skel_ops = { "skel", skel_search, - skel_search_free, skel_add_record, skel_modify_record, skel_delete_record, -- cgit From 3d97821243b0d4af866ccc158e0134a49c0e4901 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 22 May 2005 10:27:51 +0000 Subject: 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) --- source4/lib/ldb/modules/skel.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') 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; -- cgit From e4553307c1e3e44a7f772818aae18cca0aca92a3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 22 May 2005 10:40:54 +0000 Subject: r6935: don't do three things at a time :-) (This used to be commit a97eb63c11be6ce2bb94bca61078b303f15c9b9a) --- source4/lib/ldb/modules/skel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 33e5d53cef..9fb01941c9 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -36,7 +36,8 @@ #include "ldb/include/ldb.h" #include "ldb/include/ldb_private.h" -static struct private_data { +const struct private_data { + const char *error_string; }; @@ -133,7 +134,6 @@ struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options ctx->ldb = ldb; ctx->prev = ctx->next = NULL; - ctx->private_data = NULL; ctx->ops = &skel_ops; talloc_set_destructor (ctx, skel_destructor); -- cgit From 4f4b92a6904210a467282a997e81a4e8ab1f415a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 23 May 2005 06:49:17 +0000 Subject: r6937: some minor fixes and updates metze (This used to be commit 03b1ff48f97fa81c515f90a398c6f8cde579cb51) --- source4/lib/ldb/modules/skel.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') 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; -- cgit From 4b0e5bd75373ffa2d847706a71fd0349dfa15e71 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Jun 2005 09:10:17 +0000 Subject: r7527: - added a ldb_search_bytree() interface, which takes a ldb_parse_tree instead of a search expression. This allows our ldap server to pass its ASN.1 parsed search expressions straight to ldb, instead of going via strings. - updated all the ldb modules code to handle the new interface - got rid of the separate ldb_parse.h now that the ldb_parse structures are exposed externally - moved to C99 structure initialisation in ldb - switched ldap server to using ldb_search_bytree() (This used to be commit 96620ab2ee5d440bbbc51c1bc0cad9977770f897) --- source4/lib/ldb/modules/skel.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 505b19a288..1221ac70f1 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -103,6 +103,7 @@ static int skel_destructor(void *module_ctx) static const struct ldb_module_ops skel_ops = { .name = "skel", .search = skel_search, + .search_bytree = skel_search_bytree, .add_record = skel_add_record, .modify_record = skel_modify_record, .delete_record = skel_delete_record, -- cgit From 3e4c4cff2177af33efdb15f03a1bbcb639505cee Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 18 Aug 2005 15:02:01 +0000 Subject: r9391: Convert all the code to use struct ldb_dn to ohandle ldap like distinguished names Provide more functions to handle DNs in this form (This used to be commit 692e35b7797e39533dd2a1c4b63d9da30f1eb5ba) --- source4/lib/ldb/modules/skel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 1221ac70f1..57c89a6a65 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -42,7 +42,7 @@ struct private_data { }; /* search */ -static int skel_search(struct ldb_module *module, const char *base, +static int skel_search(struct ldb_module *module, const struct ldb_dn *base, enum ldb_scope scope, const char *expression, const char * const *attrs, struct ldb_message ***res) { @@ -62,13 +62,13 @@ static int skel_modify_record(struct ldb_module *module, const struct ldb_messag } /* delete_record */ -static int skel_delete_record(struct ldb_module *module, const char *dn) +static int skel_delete_record(struct ldb_module *module, const struct ldb_dn *dn) { return ldb_next_delete_record(module, dn); } /* rename_record */ -static int skel_rename_record(struct ldb_module *module, const char *olddn, const char *newdn) +static int skel_rename_record(struct ldb_module *module, const struct ldb_dn *olddn, const struct ldb_dn *newdn) { return ldb_next_rename_record(module, olddn, newdn); } -- cgit From 8919d6bf9a88ce9ac43dae61989c33082c984b66 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 17 Sep 2005 19:25:50 +0000 Subject: r10299: remove the public (un)lock functions and introduce a transaction based private ldb API ldb_sqlite3 is already working with this model and ldb_tdb will do as soon as tridge finishes the tdb transaction code. currently the transactions are always implicit and wrap any single ldb API call except searching, the transaction functions are currently not made public on purpose. Simo. (This used to be commit 1da4ac2cdcb7e54076f85242a93784260dced918) --- source4/lib/ldb/modules/skel.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 57c89a6a65..37c0417c64 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -73,16 +73,16 @@ static int skel_rename_record(struct ldb_module *module, const struct ldb_dn *ol return ldb_next_rename_record(module, olddn, newdn); } -/* named_lock */ -static int skel_named_lock(struct ldb_module *module, const char *lockname) +/* start a transaction */ +static int skel_start_trans(struct ldb_module *module) { - return ldb_next_named_lock(module, lockname); + return ldb_next_start_trans(module); } -/* named_unlock */ -static int skel_named_unlock(struct ldb_module *module, const char *lockname) +/* end a transaction */ +static int skel_end_trans(struct ldb_module *module, int status) { - return ldb_next_named_unlock(module, lockname); + return ldb_next_end_trans(module, status); } /* return extended error information */ @@ -101,16 +101,16 @@ static int skel_destructor(void *module_ctx) } static const struct ldb_module_ops skel_ops = { - .name = "skel", - .search = skel_search, - .search_bytree = skel_search_bytree, - .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 + .name = "skel", + .search = skel_search, + .search_bytree = skel_search_bytree, + .add_record = skel_add_record, + .modify_record = skel_modify_record, + .delete_record = skel_delete_record, + .rename_record = skel_rename_record, + .start_transaction = skel_start_trans, + .end_transaction = skel_end_trans, + .errstring = skel_errstring }; #ifdef HAVE_DLOPEN_DISABLED -- cgit From 16aff2a184f7fab64d718b356056070e305e99e9 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 18 Sep 2005 18:49:06 +0000 Subject: r10305: start implementing better error handling changed the prioivate modules API error string are now not spread over all modules but are kept in a single place. This allows a better control of memory and error reporting. (This used to be commit 3fc676ac1d6f59d08bedbbd9377986154cf84ce4) --- source4/lib/ldb/modules/skel.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 37c0417c64..701128cd27 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -38,7 +38,7 @@ struct private_data { - char *errstring; + char *some_private_data; }; /* search */ @@ -85,18 +85,12 @@ static int skel_end_trans(struct ldb_module *module, int status) return ldb_next_end_trans(module, status); } -/* return extended error information */ -static const char *skel_errstring(struct ldb_module *module) -{ - return ldb_next_errstring(module); -} - static int skel_destructor(void *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); + if (data->some_private_data) talloc_free(data->some_private_data); return 0; } @@ -110,7 +104,6 @@ static const struct ldb_module_ops skel_ops = { .rename_record = skel_rename_record, .start_transaction = skel_start_trans, .end_transaction = skel_end_trans, - .errstring = skel_errstring }; #ifdef HAVE_DLOPEN_DISABLED @@ -132,7 +125,7 @@ struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options return NULL; } - data->errstring = NULL; + data->some_private_data = NULL; ctx->private_data = data; ctx->ldb = ldb; -- cgit From 63b43dd12fb579aaaccedd07aaa630cb1cd7aa88 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 24 Sep 2005 15:42:15 +0000 Subject: r10477: expose transactions outside ldb and change the API once more do not autostart transactions on ldb operations if a transaction is already in place test transactions on winsdb all my tests passes so far tridge please confirm this is ok for you (This used to be commit c2bb2a36bdbe0ec7519697a9a9ba7526a0defac2) --- source4/lib/ldb/modules/skel.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 701128cd27..5d14a27a7b 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -80,9 +80,15 @@ static int skel_start_trans(struct ldb_module *module) } /* end a transaction */ -static int skel_end_trans(struct ldb_module *module, int status) +static int skel_end_trans(struct ldb_module *module) { - return ldb_next_end_trans(module, status); + return ldb_next_end_trans(module); +} + +/* delete a transaction */ +static int skel_del_trans(struct ldb_module *module) +{ + return ldb_next_del_trans(module); } static int skel_destructor(void *module_ctx) @@ -104,6 +110,7 @@ static const struct ldb_module_ops skel_ops = { .rename_record = skel_rename_record, .start_transaction = skel_start_trans, .end_transaction = skel_end_trans, + .del_transaction = skel_del_trans, }; #ifdef HAVE_DLOPEN_DISABLED -- cgit From 5fd031c97daaa1bf09a7ad80550753acd434075f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Oct 2005 05:24:46 +0000 Subject: r10753: don't require every ldb module to implement both a search_bytree() and a search() function, instead each module now only implements the bytree method, and the expression based search is handled generically by the modules code. This makes for more consistency and less code duplication. fixed the tdb backend to handle BASE searches much more efficiently. They now always only lookup one record, regardless of the search expression (This used to be commit 7e44f9153c5578624e2fca04cdc0a00af0fd9eb4) --- source4/lib/ldb/modules/skel.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 5d14a27a7b..f882a840e1 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -43,10 +43,10 @@ struct private_data { /* search */ static int skel_search(struct ldb_module *module, const struct ldb_dn *base, - enum ldb_scope scope, const char *expression, + enum ldb_scope scope, struct ldb_parse_tree *tree, const char * const *attrs, struct ldb_message ***res) { - return ldb_next_search(module, base, scope, expression, attrs, res); + return ldb_next_search(module, base, scope, tree, attrs, res); } /* add_record */ @@ -102,8 +102,7 @@ static int skel_destructor(void *module_ctx) static const struct ldb_module_ops skel_ops = { .name = "skel", - .search = skel_search, - .search_bytree = skel_search_bytree, + .search_bytree = skel_search_bytree, .add_record = skel_add_record, .modify_record = skel_modify_record, .delete_record = skel_delete_record, -- cgit From 5c9590587197dcb95007fdc54318187d5716c7c6 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 8 Nov 2005 00:11:45 +0000 Subject: r11567: Ldb API change patch. This patch changes the way lsb_search is called and the meaning of the returned integer. The last argument of ldb_search is changed from struct ldb_message to struct ldb_result which contains a pointer to a struct ldb_message list and a count of the number of messages. The return is not the count of messages anymore but instead it is an ldb error value. I tryed to keep the patch as tiny as possible bu as you can guess I had to change a good amount of places. I also tried to double check all my changes being sure that the calling functions would still behave as before. But this patch is big enough that I fear some bug may have been introduced anyway even if it passes the test suite. So if you are currently working on any file being touched please give it a deep look and blame me for any error. Simo. (This used to be commit 22c8c97e6fb466b41859e090e959d7f1134be780) --- source4/lib/ldb/modules/skel.c | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index f882a840e1..a3dcfc21bb 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -44,7 +44,7 @@ struct private_data { /* search */ static int skel_search(struct ldb_module *module, const struct ldb_dn *base, enum ldb_scope scope, struct ldb_parse_tree *tree, - const char * const *attrs, struct ldb_message ***res) + const char * const *attrs, struct ldb_result **res) { return ldb_next_search(module, base, scope, tree, attrs, res); } @@ -100,13 +100,41 @@ static int skel_destructor(void *module_ctx) return 0; } +static int skel_request(struct ldb_module *module, struct ldb_request *req) +{ + switch (req->operation) { + + case LDB_REQ_SEARCH: + return skel_search_bytree(module, + req->op.search->base, + req->op.search->scope, + req->op.search->tree, + req->op.search->attrs, + req->op.search->res); + + case LDB_REQ_ADD: + return skel_add(module, req->op.add->message); + + case LDB_REQ_MODIFY: + return skel_modify(module, req->op.mod->message); + + case LDB_REQ_DELETE: + return skel_delete(module, req->op.del->dn); + + case LDB_REQ_RENAME: + return skel_rename(module, + req->op.rename->olddn, + req->op.rename->newdn); + + default: + return ldb_next_request(module, req); + + } +} + static const struct ldb_module_ops skel_ops = { .name = "skel", - .search_bytree = skel_search_bytree, - .add_record = skel_add_record, - .modify_record = skel_modify_record, - .delete_record = skel_delete_record, - .rename_record = skel_rename_record, + .request = skel_request, .start_transaction = skel_start_trans, .end_transaction = skel_end_trans, .del_transaction = skel_del_trans, -- cgit From 3b99d9c5bd563203adc4b017d6e6599dd84b8d57 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 1 Jan 2006 17:32:10 +0000 Subject: r12658: Couple of fixes related to shared module builds. (This used to be commit c297c93faf3b748de68679f5a4be50845ebe25fe) --- source4/lib/ldb/modules/skel.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index a3dcfc21bb..fcec0f3fd8 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -140,11 +140,7 @@ static const struct ldb_module_ops skel_ops = { .del_transaction = skel_del_trans, }; -#ifdef HAVE_DLOPEN_DISABLED -struct ldb_module *init_module(struct ldb_context *ldb, const char *options[]) -#else struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options[]) -#endif { struct ldb_module *ctx; struct private_data *data; -- cgit From 28456784e9c547f564635fe32df48eccecfc84b6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 5 Jan 2006 04:56:19 +0000 Subject: r12717: Always compile the skel module, so we know when we break it. Also fix up all the current issues with the skel module. Andrew Bartlett (This used to be commit d0a0a8de3fa73d8f06a801203e00b90ed8359b98) --- source4/lib/ldb/modules/skel.c | 47 +++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index fcec0f3fd8..1bbb81f288 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -42,35 +42,32 @@ struct private_data { }; /* search */ -static int skel_search(struct ldb_module *module, const struct ldb_dn *base, - enum ldb_scope scope, struct ldb_parse_tree *tree, - const char * const *attrs, struct ldb_result **res) +static int skel_search(struct ldb_module *module, struct ldb_request *req) { - return ldb_next_search(module, base, scope, tree, attrs, res); + return ldb_next_request(module, req); } -/* add_record */ -static int skel_add_record(struct ldb_module *module, const struct ldb_message *msg) -{ - return ldb_next_add_record(module, msg); +/* add */ +static int skel_add(struct ldb_module *module, struct ldb_request *req){ + return ldb_next_request(module, req); } -/* modify_record */ -static int skel_modify_record(struct ldb_module *module, const struct ldb_message *msg) +/* modify */ +static int skel_modify(struct ldb_module *module, struct ldb_request *req) { - return ldb_next_modify_record(module, msg); + return ldb_next_request(module, req); } -/* delete_record */ -static int skel_delete_record(struct ldb_module *module, const struct ldb_dn *dn) +/* delete */ +static int skel_delete(struct ldb_module *module, struct ldb_request *req) { - return ldb_next_delete_record(module, dn); + return ldb_next_request(module, req); } -/* rename_record */ -static int skel_rename_record(struct ldb_module *module, const struct ldb_dn *olddn, const struct ldb_dn *newdn) +/* rename */ +static int skel_rename(struct ldb_module *module, struct ldb_request *req) { - return ldb_next_rename_record(module, olddn, newdn); + return ldb_next_request(module, req); } /* start a transaction */ @@ -105,26 +102,20 @@ static int skel_request(struct ldb_module *module, struct ldb_request *req) switch (req->operation) { case LDB_REQ_SEARCH: - return skel_search_bytree(module, - req->op.search->base, - req->op.search->scope, - req->op.search->tree, - req->op.search->attrs, - req->op.search->res); + return skel_search(module, req); case LDB_REQ_ADD: - return skel_add(module, req->op.add->message); + return skel_add(module, req); case LDB_REQ_MODIFY: - return skel_modify(module, req->op.mod->message); + return skel_modify(module, req); case LDB_REQ_DELETE: - return skel_delete(module, req->op.del->dn); + return skel_delete(module, req); case LDB_REQ_RENAME: return skel_rename(module, - req->op.rename->olddn, - req->op.rename->newdn); + req); default: return ldb_next_request(module, req); -- cgit From c908d0b2aa111659e57a73efb8c33c413965c846 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 6 Jan 2006 04:01:23 +0000 Subject: r12733: Merge ldap/ldb controls into main tree There's still lot of work to do but the patch is stable enough to be pushed into the main samba4 tree. Simo. (This used to be commit 77125feaff252cab44d26593093a9c211c846ce8) --- source4/lib/ldb/modules/skel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 1bbb81f288..dacbd6960e 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -131,11 +131,17 @@ static const struct ldb_module_ops skel_ops = { .del_transaction = skel_del_trans, }; -struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options[]) +struct ldb_module *skel_module_init(struct ldb_context *ldb, int stage, const char *options[]) { struct ldb_module *ctx; struct private_data *data; + if (stage == LDB_MODULES_INIT_STAGE_2) { + /* second stage init stuff */ + /* see control modules as example */ + return NULL; + } + ctx = talloc(ldb, struct ldb_module); if (!ctx) return NULL; -- cgit From dbef4d76de92c3388f4e1819a76d6febf90be290 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 6 Jan 2006 16:12:45 +0000 Subject: r12743: Remove the ugly way we had to make a second stage init and introduce a second_stage_init private function for modules that need a second stage init. Simo. (This used to be commit 5e8b365fa2d93801a5de1d9ea76ce9d5546bd248) --- source4/lib/ldb/modules/skel.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index dacbd6960e..10f730b2f9 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -123,25 +123,27 @@ static int skel_request(struct ldb_module *module, struct ldb_request *req) } } +static int skel_init_2(struct ldb_module *module) +{ + /* second stage init stuff */ + /* see control modules as example */ + return ldb_next_second_stage_init(module); +} + static const struct ldb_module_ops skel_ops = { .name = "skel", .request = skel_request, .start_transaction = skel_start_trans, .end_transaction = skel_end_trans, .del_transaction = skel_del_trans, + .second_stage_init = skel_init_2 }; -struct ldb_module *skel_module_init(struct ldb_context *ldb, int stage, const char *options[]) +struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options[]) { struct ldb_module *ctx; struct private_data *data; - if (stage == LDB_MODULES_INIT_STAGE_2) { - /* second stage init stuff */ - /* see control modules as example */ - return NULL; - } - ctx = talloc(ldb, struct ldb_module); if (!ctx) return NULL; -- cgit From 4d1c5a023cf6680474bd8d8be73f576d155cfe81 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 10 Jan 2006 16:48:32 +0000 Subject: r12829: fix ldb headers, to not include '<...>' files in .c files this helps in getting symbol -fvisibility=hidden (GCC 4 feature) working later. metze (This used to be commit 380938e97f31c7860aed1e73cc0110c6e17b472e) --- source4/lib/ldb/modules/skel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 10f730b2f9..e9b76be2ba 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -33,8 +33,7 @@ */ #include "includes.h" -#include "ldb/include/ldb.h" -#include "ldb/include/ldb_private.h" +#include "ldb/include/includes.h" struct private_data { -- cgit From 26af14c39b88b0e7eb53657b89be65d865804688 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 2 Mar 2006 16:32:53 +0000 Subject: r13786: [merge] Add registration functions for LDB modules Applications that use LDB modules will now have to run ldb_global_init() before they can use LDB. The next step will be adding support for loading LDB modules from .so files. This will also allow us to use one LDB without difference between the standalone and the Samba-specific build (This used to be commit 52a235650514039bf8ffee99a784bbc1b6ae6b92) --- source4/lib/ldb/modules/skel.c | 46 ++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index e9b76be2ba..0089433b37 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -122,45 +122,33 @@ static int skel_request(struct ldb_module *module, struct ldb_request *req) } } -static int skel_init_2(struct ldb_module *module) +static int skel_init(struct ldb_module *ctx) { - /* second stage init stuff */ - /* see control modules as example */ - return ldb_next_second_stage_init(module); -} - -static const struct ldb_module_ops skel_ops = { - .name = "skel", - .request = skel_request, - .start_transaction = skel_start_trans, - .end_transaction = skel_end_trans, - .del_transaction = skel_del_trans, - .second_stage_init = skel_init_2 -}; - -struct ldb_module *skel_module_init(struct ldb_context *ldb, const char *options[]) -{ - struct ldb_module *ctx; struct private_data *data; - ctx = talloc(ldb, struct ldb_module); - if (!ctx) - return NULL; - data = talloc(ctx, struct private_data); if (data == NULL) { - talloc_free(ctx); - return NULL; + return 1; } data->some_private_data = NULL; ctx->private_data = data; - ctx->ldb = ldb; - ctx->prev = ctx->next = NULL; - ctx->ops = &skel_ops; - talloc_set_destructor (ctx, skel_destructor); - return ctx; + return ldb_next_init(ctx); +} + +static const struct ldb_module_ops skel_ops = { + .name = "skel", + .init_context = skel_init, + .request = skel_request, + .start_transaction = skel_start_trans, + .end_transaction = skel_end_trans, + .del_transaction = skel_del_trans, +}; + +int ldb_skel_init(void) +{ + return ldb_register_module(&skel_ops); } -- cgit From 971d30bb201f5c3faff5f575d26882eb79f7955a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 May 2006 07:34:11 +0000 Subject: r15854: more talloc_set_destructor() typesafe fixes (This used to be commit 61c6100617589ac6df4f527877241464cacbf8b3) --- source4/lib/ldb/modules/skel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 0089433b37..2f3c2e8b57 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -87,9 +87,8 @@ static int skel_del_trans(struct ldb_module *module) return ldb_next_del_trans(module); } -static int skel_destructor(void *module_ctx) +static int skel_destructor(struct ldb_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->some_private_data) talloc_free(data->some_private_data); -- cgit From 3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 29 May 2006 01:30:02 +0000 Subject: r15927: Optimize ldb module traverse while keeping the API intact. I was sick of jumping inot each module for each request, even the ones not handle by that module. (This used to be commit 7d65105e885a28584e8555453b90232c43a92bf7) --- source4/lib/ldb/modules/skel.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 2f3c2e8b57..2adef580b1 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -97,28 +97,7 @@ static int skel_destructor(struct ldb_module *ctx) static int skel_request(struct ldb_module *module, struct ldb_request *req) { - switch (req->operation) { - - case LDB_REQ_SEARCH: - return skel_search(module, req); - - case LDB_REQ_ADD: - return skel_add(module, req); - - case LDB_REQ_MODIFY: - return skel_modify(module, req); - - case LDB_REQ_DELETE: - return skel_delete(module, req); - - case LDB_REQ_RENAME: - return skel_rename(module, - req); - - default: - return ldb_next_request(module, req); - - } + return ldb_next_request(module, req); } static int skel_init(struct ldb_module *ctx) @@ -141,6 +120,11 @@ static int skel_init(struct ldb_module *ctx) static const struct ldb_module_ops skel_ops = { .name = "skel", .init_context = skel_init, + .search = skel_search, + .add = skel_add, + .modify = skel_modify, + .del = skel_delete, + .rename = skel_rename, .request = skel_request, .start_transaction = skel_start_trans, .end_transaction = skel_end_trans, -- cgit From 20df8d8305d2dc50096ae40bbcb16a1e2b5134ea Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 13 Feb 2007 03:52:57 +0000 Subject: r21305: Change the skel module a little, so make it names clearer. Andrew Bartlett (This used to be commit 26758fc24ca0b28e1ed07cc20801175e94362d57) --- source4/lib/ldb/modules/skel.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 2adef580b1..8622a22638 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -100,21 +100,22 @@ static int skel_request(struct ldb_module *module, struct ldb_request *req) return ldb_next_request(module, req); } -static int skel_init(struct ldb_module *ctx) +static int skel_init(struct ldb_module *module) { struct private_data *data; - data = talloc(ctx, struct private_data); + data = talloc(module, struct private_data); if (data == NULL) { - return 1; + ldb_oom(module->ldb); + return LDB_ERR_OPERATIONS_ERROR; } data->some_private_data = NULL; - ctx->private_data = data; + module->private_data = data; - talloc_set_destructor (ctx, skel_destructor); + talloc_set_destructor (module, skel_destructor); - return ldb_next_init(ctx); + return ldb_next_init(module); } static const struct ldb_module_ops skel_ops = { -- cgit From 52fb06edc25e8538c413df1aaabba18c859a00cf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 5 May 2007 18:50:56 +0000 Subject: r22681: Fix standalone ldb build when parent directory name != ldb. (This used to be commit 1093875d59f1ea9b8bd82277d4f9d8366e584952) --- source4/lib/ldb/modules/skel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 8622a22638..3496142419 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -32,8 +32,7 @@ * Author: Simo Sorce */ -#include "includes.h" -#include "ldb/include/includes.h" +#include "ldb_includes.h" struct private_data { -- cgit From b8d69a7ea2505b706ff7c74d7c97bc89d82dfa07 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:46:15 +0000 Subject: r23795: more v2->v3 conversion (This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac) --- source4/lib/ldb/modules/skel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 3496142419..70759b9704 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -10,7 +10,7 @@ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit From 6c973f4e8ccbcb6c9275f8a54e26abb19df7e15a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 03:42:26 +0000 Subject: r23798: updated old Temple Place FSF addresses to new URL (This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb) --- source4/lib/ldb/modules/skel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 70759b9704..5400c502f1 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -18,8 +18,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + License along with this library; if not, see . */ /* -- cgit From 16109a40c0abd8c30a5eb9bf9ef692bfae9dfc7d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 20 Feb 2008 01:54:32 +0100 Subject: Use struct-based rather than function-based initialization for ldb modules everywhere. (This used to be commit 85c96a325867f7bcdb412ebc53f8a47dbf7cd89b) --- source4/lib/ldb/modules/skel.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source4/lib/ldb/modules/skel.c') diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c index 5400c502f1..0cd29ac4b7 100644 --- a/source4/lib/ldb/modules/skel.c +++ b/source4/lib/ldb/modules/skel.c @@ -116,7 +116,7 @@ static int skel_init(struct ldb_module *module) return ldb_next_init(module); } -static const struct ldb_module_ops skel_ops = { +const struct ldb_module_ops ldb_skel_module_ops = { .name = "skel", .init_context = skel_init, .search = skel_search, @@ -129,8 +129,3 @@ static const struct ldb_module_ops skel_ops = { .end_transaction = skel_end_trans, .del_transaction = skel_del_trans, }; - -int ldb_skel_init(void) -{ - return ldb_register_module(&skel_ops); -} -- cgit