summaryrefslogtreecommitdiff
path: root/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2012-10-31 16:06:03 +1100
committerAndrew Tridgell <tridge@samba.org>2012-11-01 15:40:41 +1100
commit30ffdda45bd3ae602b453c9c1bbdb77ea3de8a8d (patch)
tree2859583eec07abce06678d464aea79501dd3e554 /lib/ldb/ldb_tdb
parentfc47b0d03c577730ce0ef9e09092f80c0712d5d0 (diff)
downloadsamba-30ffdda45bd3ae602b453c9c1bbdb77ea3de8a8d.tar.gz
samba-30ffdda45bd3ae602b453c9c1bbdb77ea3de8a8d.tar.bz2
samba-30ffdda45bd3ae602b453c9c1bbdb77ea3de8a8d.zip
ldb: fixed callers for ldb_pack_data() and ldb_unpack_data()
with ltdb_pack_data() and ltdb_unpack_data() now moved into common, we need to increase the minor version and fixup callers of the API Note that this relies on struct ldb_val being the same shape as TDB_DATA, in much the same way as we rely on ldb_val and DATA_BLOB being the same shape. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/ldb/ldb_tdb')
-rw-r--r--lib/ldb/ldb_tdb/ldb_index.c3
-rw-r--r--lib/ldb/ldb_tdb/ldb_search.c5
-rw-r--r--lib/ldb/ldb_tdb/ldb_tdb.c5
-rw-r--r--lib/ldb/ldb_tdb/ldb_tdb.h9
4 files changed, 8 insertions, 14 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c
index 50c6ded56a..d79417f442 100644
--- a/lib/ldb/ldb_tdb/ldb_index.c
+++ b/lib/ldb/ldb_tdb/ldb_index.c
@@ -32,6 +32,7 @@
*/
#include "ldb_tdb.h"
+#include "ldb_private.h"
struct dn_list {
unsigned int count;
@@ -1509,7 +1510,7 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
return -1;
}
- ret = ltdb_unpack_data(ldb, &data, msg);
+ ret = ldb_unpack_data(ldb, (struct ldb_val *)&data, msg);
if (ret != 0) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid data for index %s\n",
ldb_dn_get_linearized(msg->dn));
diff --git a/lib/ldb/ldb_tdb/ldb_search.c b/lib/ldb/ldb_tdb/ldb_search.c
index 4fb8510377..26296c7f7d 100644
--- a/lib/ldb/ldb_tdb/ldb_search.c
+++ b/lib/ldb/ldb_tdb/ldb_search.c
@@ -32,6 +32,7 @@
*/
#include "ldb_tdb.h"
+#include "ldb_private.h"
#include <tdb.h>
/*
@@ -245,7 +246,7 @@ static int ltdb_parse_data_unpack(TDB_DATA key, TDB_DATA data,
struct ltdb_parse_data_unpack_ctx *ctx = private_data;
struct ldb_context *ldb = ldb_module_get_ctx(ctx->module);
- int ret = ltdb_unpack_data(ldb, &data, ctx->msg);
+ int ret = ldb_unpack_data(ldb, (struct ldb_val *)&data, ctx->msg);
if (ret == -1) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid data for index %*.*s\n",
(int)key.dsize, (int)key.dsize, key.dptr);
@@ -440,7 +441,7 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi
}
/* unpack the record */
- ret = ltdb_unpack_data(ldb, &data, msg);
+ ret = ldb_unpack_data(ldb, (struct ldb_val *)&data, msg);
if (ret == -1) {
talloc_free(msg);
return -1;
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index 0e7c74c640..860ee146a6 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -50,6 +50,7 @@
*/
#include "ldb_tdb.h"
+#include "ldb_private.h"
#include <tdb.h>
/*
@@ -264,7 +265,7 @@ int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flg
return LDB_ERR_OTHER;
}
- ret = ltdb_pack_data(module, msg, &tdb_data);
+ ret = ldb_pack_data(module, msg, (struct ldb_val *)&tdb_data);
if (ret == -1) {
talloc_free(tdb_key.dptr);
return LDB_ERR_OTHER;
@@ -693,7 +694,7 @@ int ltdb_modify_internal(struct ldb_module *module,
goto done;
}
- ret = ltdb_unpack_data(ldb_module_get_ctx(module), &tdb_data, msg2);
+ ret = ldb_unpack_data(ldb_module_get_ctx(module), (struct ldb_val *)&tdb_data, msg2);
free(tdb_data.dptr);
if (ret == -1) {
ret = LDB_ERR_OTHER;
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.h b/lib/ldb/ldb_tdb/ldb_tdb.h
index dd7162663e..b9aa36caaa 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.h
+++ b/lib/ldb/ldb_tdb/ldb_tdb.h
@@ -92,15 +92,6 @@ int ltdb_index_transaction_start(struct ldb_module *module);
int ltdb_index_transaction_commit(struct ldb_module *module);
int ltdb_index_transaction_cancel(struct ldb_module *module);
-/* The following definitions come from lib/ldb/ldb_tdb/ldb_pack.c */
-
-int ltdb_pack_data(struct ldb_module *module,
- const struct ldb_message *message,
- TDB_DATA *data);
-int ltdb_unpack_data(struct ldb_context *ldb,
- const TDB_DATA *data,
- struct ldb_message *message);
-
/* The following definitions come from lib/ldb/ldb_tdb/ldb_search.c */
int ltdb_has_wildcard(struct ldb_module *module, const char *attr_name,