summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-06-20 18:40:31 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-06-20 11:18:35 +0200
commit058c4f84924c07b88ccaf3d617f3abff797a7cc8 (patch)
treec9ea7b1331a55fb73f832203dd9f643b7c216fd2
parent0e4c358e2710580d5aeb439d767c87aaf4c0f2f3 (diff)
downloadsamba-058c4f84924c07b88ccaf3d617f3abff797a7cc8.tar.gz
tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--lib/util/util_tdb.c6
-rw-r--r--source3/lib/dbwrap_ctdb.c10
-rw-r--r--source3/lib/eventlog/eventlog.c4
-rw-r--r--source3/lib/gencache.c2
-rw-r--r--source3/lib/messages_local.c2
-rw-r--r--source3/libsmb/smb_share_modes.c10
-rw-r--r--source3/nmbd/nmbd_winsserver.c2
-rw-r--r--source3/printing/nt_printing_migrate.c2
-rw-r--r--source3/printing/nt_printing_tdb.c2
-rw-r--r--source3/printing/printing.c28
-rw-r--r--source3/registry/reg_perfcount.c16
-rw-r--r--source3/utils/net_printing.c4
-rw-r--r--source3/winbindd/winbindd_cache.c10
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c4
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c5
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c3
-rw-r--r--source4/ntvfs/common/brlock_tdb.c12
-rw-r--r--source4/ntvfs/common/opendb_tdb.c2
-rw-r--r--source4/ntvfs/posix/xattr_tdb.c2
-rw-r--r--source4/torture/local/dbspeed.c4
20 files changed, 66 insertions, 64 deletions
diff --git a/lib/util/util_tdb.c b/lib/util/util_tdb.c
index 33615854bd8..2dd5f9dd5fe 100644
--- a/lib/util/util_tdb.c
+++ b/lib/util/util_tdb.c
@@ -111,7 +111,7 @@ int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key)
TDB_DATA data;
int32_t ret;
- data = tdb_fetch(tdb, key);
+ data = tdb_fetch_compat(tdb, key);
if (!data.dptr || data.dsize != sizeof(int32_t)) {
SAFE_FREE(data.dptr);
return -1;
@@ -168,7 +168,7 @@ bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t *va
{
TDB_DATA data;
- data = tdb_fetch(tdb, key);
+ data = tdb_fetch_compat(tdb, key);
if (!data.dptr || data.dsize != sizeof(uint32_t)) {
SAFE_FREE(data.dptr);
return false;
@@ -240,7 +240,7 @@ TDB_DATA tdb_fetch_bystring(struct tdb_context *tdb, const char *keystr)
{
TDB_DATA key = string_term_tdb_data(keystr);
- return tdb_fetch(tdb, key);
+ return tdb_fetch_compat(tdb, key);
}
/****************************************************************************
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 935bb03f34c..45c134cf803 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -91,7 +91,7 @@ static NTSTATUS db_ctdb_ltdb_fetch(struct db_ctdb_ctx *db,
TDB_DATA rec;
NTSTATUS status;
- rec = tdb_fetch(db->wtdb->tdb, key);
+ rec = tdb_fetch_compat(db->wtdb->tdb, key);
if (rec.dsize < sizeof(struct ctdb_ltdb_header)) {
status = NT_STATUS_NOT_FOUND;
if (data) {
@@ -539,7 +539,7 @@ static struct db_record *db_ctdb_fetch_locked_transaction(struct db_ctdb_ctx *ct
return result;
}
- ctdb_data = tdb_fetch(ctx->wtdb->tdb, key);
+ ctdb_data = tdb_fetch_compat(ctx->wtdb->tdb, key);
if (ctdb_data.dptr == NULL) {
/* create the record */
result->value = tdb_null;
@@ -625,7 +625,7 @@ static NTSTATUS db_ctdb_transaction_store(struct db_ctdb_transaction_handle *h,
if (!pull_newest_from_marshall_buffer(h->m_write, key, &header,
NULL, NULL)) {
- rec = tdb_fetch(h->ctx->wtdb->tdb, key);
+ rec = tdb_fetch_compat(h->ctx->wtdb->tdb, key);
if (rec.dptr != NULL) {
memcpy(&header, rec.dptr,
@@ -1066,7 +1066,7 @@ again:
result->delete_rec = db_ctdb_delete;
talloc_set_destructor(result, db_ctdb_record_destr);
- ctdb_data = tdb_fetch(ctx->wtdb->tdb, key);
+ ctdb_data = tdb_fetch_compat(ctx->wtdb->tdb, key);
/*
* See if we have a valid record and we are the dmaster. If so, we can
@@ -1166,7 +1166,7 @@ static int db_ctdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
}
/* try a direct fetch */
- ctdb_data = tdb_fetch(ctx->wtdb->tdb, key);
+ ctdb_data = tdb_fetch_compat(ctx->wtdb->tdb, key);
/*
* See if we have a valid record and we are the dmaster. If so, we can
diff --git a/source3/lib/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c
index 556938fe1d0..b719c6f7f8c 100644
--- a/source3/lib/eventlog/eventlog.c
+++ b/source3/lib/eventlog/eventlog.c
@@ -203,7 +203,7 @@ static bool make_way_for_eventlogs( TDB_CONTEXT * the_tdb, int32_t needed,
/* read a record, add the amt to nbytes */
key.dsize = sizeof(int32_t);
key.dptr = (unsigned char *)&i;
- ret = tdb_fetch( the_tdb, key );
+ ret = tdb_fetch_compat( the_tdb, key );
if ( ret.dsize == 0 ) {
DEBUG( 8,
( "Can't find a record for the key, record [%d]\n",
@@ -679,7 +679,7 @@ struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx,
key.dptr = (unsigned char *)&srecno;
key.dsize = sizeof(int32_t);
- data = tdb_fetch(tdb, key);
+ data = tdb_fetch_compat(tdb, key);
if (data.dsize == 0) {
DEBUG(8,("evlog_pull_record_tdb: "
"Can't find a record for the key, record %d\n",
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 8d4861a1769..5e154728297 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -206,7 +206,7 @@ bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
*/
last_stabilize = 0;
- databuf = tdb_fetch(cache_notrans, last_stabilize_key());
+ databuf = tdb_fetch_compat(cache_notrans, last_stabilize_key());
if ((databuf.dptr != NULL)
&& (databuf.dptr[databuf.dsize-1] == '\0')) {
last_stabilize = atoi((char *)databuf.dptr);
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c
index 09b87062621..d7f370c9e48 100644
--- a/source3/lib/messages_local.c
+++ b/source3/lib/messages_local.c
@@ -191,7 +191,7 @@ static NTSTATUS messaging_tdb_fetch(TDB_CONTEXT *msg_tdb,
return NT_STATUS_NO_MEMORY;
}
- data = tdb_fetch(msg_tdb, key);
+ data = tdb_fetch_compat(msg_tdb, key);
if (data.dptr == NULL) {
*presult = result;
diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c
index bb405969f37..2bf430dfea5 100644
--- a/source3/libsmb/smb_share_modes.c
+++ b/source3/libsmb/smb_share_modes.c
@@ -201,8 +201,8 @@ int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx,
*pp_list = NULL;
*p_delete_on_close = 0;
- db_data = tdb_fetch(db_ctx->smb_tdb, get_locking_key(&lk, dev, ino,
- extid));
+ db_data = tdb_fetch_compat(db_ctx->smb_tdb,
+ get_locking_key(&lk, dev, ino, extid));
if (!db_data.dptr) {
return 0;
}
@@ -315,7 +315,7 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx,
return -1;
}
- db_data = tdb_fetch(db_ctx->smb_tdb, locking_key);
+ db_data = tdb_fetch_compat(db_ctx->smb_tdb, locking_key);
if (!db_data.dptr) {
/* We must create the entry. */
db_data.dptr = (uint8 *)malloc(
@@ -432,7 +432,7 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx,
size_t i, num_share_modes;
const uint8 *remaining_ptr = NULL;
- db_data = tdb_fetch(db_ctx->smb_tdb, locking_key);
+ db_data = tdb_fetch_compat(db_ctx->smb_tdb, locking_key);
if (!db_data.dptr) {
return -1; /* Error - missing entry ! */
}
@@ -534,7 +534,7 @@ int smb_change_share_mode_entry(struct smbdb_ctx *db_ctx,
size_t i;
int found_entry = 0;
- db_data = tdb_fetch(db_ctx->smb_tdb, locking_key);
+ db_data = tdb_fetch_compat(db_ctx->smb_tdb, locking_key);
if (!db_data.dptr) {
return -1; /* Error - missing entry ! */
}
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c
index 1370535b7cd..50cdc0acf93 100644
--- a/source3/nmbd/nmbd_winsserver.c
+++ b/source3/nmbd/nmbd_winsserver.c
@@ -241,7 +241,7 @@ struct name_record *find_name_on_wins_subnet(const struct nmb_name *nmbname, boo
}
key = name_to_key(nmbname);
- data = tdb_fetch(wins_tdb, key);
+ data = tdb_fetch_compat(wins_tdb, key);
if (data.dsize == 0) {
return NULL;
diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c
index 03992432bfb..f6c4ef2d8b6 100644
--- a/source3/printing/nt_printing_migrate.c
+++ b/source3/printing/nt_printing_migrate.c
@@ -553,7 +553,7 @@ static NTSTATUS migrate_internal(TALLOC_CTX *mem_ctx,
kbuf.dptr;
newkey = tdb_nextkey(tdb, kbuf), free(kbuf.dptr), kbuf = newkey)
{
- dbuf = tdb_fetch(tdb, kbuf);
+ dbuf = tdb_fetch_compat(tdb, kbuf);
if (!dbuf.dptr) {
continue;
}
diff --git a/source3/printing/nt_printing_tdb.c b/source3/printing/nt_printing_tdb.c
index 3c4c661b11c..e5ae59081b3 100644
--- a/source3/printing/nt_printing_tdb.c
+++ b/source3/printing/nt_printing_tdb.c
@@ -95,7 +95,7 @@ static bool upgrade_to_version_3(void)
for (kbuf = tdb_firstkey(tdb_drivers); kbuf.dptr;
newkey = tdb_nextkey(tdb_drivers, kbuf), free(kbuf.dptr), kbuf=newkey) {
- dbuf = tdb_fetch(tdb_drivers, kbuf);
+ dbuf = tdb_fetch_compat(tdb_drivers, kbuf);
if (strncmp((const char *)kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) == 0) {
DEBUG(0,("upgrade_to_version_3:moving form\n"));
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index f15bd4f754a..2e5dbcfab24 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -88,7 +88,7 @@ uint16 pjobid_to_rap(const char* sharename, uint32 jobid)
key.dptr = (uint8 *)&jinfo;
key.dsize = sizeof(jinfo);
- data = tdb_fetch(rap_tdb, key);
+ data = tdb_fetch_compat(rap_tdb, key);
if (data.dptr && data.dsize == sizeof(uint16)) {
rap_jobid = SVAL(data.dptr, 0);
SAFE_FREE(data.dptr);
@@ -125,7 +125,7 @@ bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid)
SSVAL(buf,0,rap_jobid);
key.dptr = buf;
key.dsize = sizeof(rap_jobid);
- data = tdb_fetch(rap_tdb, key);
+ data = tdb_fetch_compat(rap_tdb, key);
if ( data.dptr && data.dsize == sizeof(struct rap_jobid_key) )
{
struct rap_jobid_key *jinfo = (struct rap_jobid_key*)data.dptr;
@@ -163,7 +163,7 @@ void rap_jobid_delete(const char* sharename, uint32 jobid)
key.dptr = (uint8 *)&jinfo;
key.dsize = sizeof(jinfo);
- data = tdb_fetch(rap_tdb, key);
+ data = tdb_fetch_compat(rap_tdb, key);
if (!data.dptr || (data.dsize != sizeof(uint16))) {
DEBUG(10,("rap_jobid_delete: cannot find jobid %u\n",
(unsigned int)jobid ));
@@ -441,7 +441,7 @@ static struct printjob *print_job_find(const char *sharename, uint32 jobid)
return NULL;
}
- ret = tdb_fetch(pdb->tdb, print_key(jobid, &tmp));
+ ret = tdb_fetch_compat(pdb->tdb, print_key(jobid, &tmp));
release_print_db(pdb);
if (!ret.dptr) {
@@ -610,7 +610,7 @@ static bool remove_from_jobs_changed(const char* sharename, uint32_t jobid)
gotlock = True;
- data = tdb_fetch(pdb->tdb, key);
+ data = tdb_fetch_compat(pdb->tdb, key);
if (data.dptr == NULL || data.dsize == 0 || (data.dsize % 4 != 0))
goto out;
@@ -728,7 +728,7 @@ static bool pjob_store(struct tevent_context *ev,
/* Get old data */
- old_data = tdb_fetch(pdb->tdb, print_key(jobid, &tmp));
+ old_data = tdb_fetch_compat(pdb->tdb, print_key(jobid, &tmp));
/* Doh! Now we have to pack/unpack data since the NT_DEVICEMODE was added */
@@ -1078,7 +1078,7 @@ static pid_t get_updating_pid(const char *sharename)
slprintf(keystr, sizeof(keystr)-1, "UPDATING/%s", sharename);
key = string_tdb_data(keystr);
- data = tdb_fetch(pdb->tdb, key);
+ data = tdb_fetch_compat(pdb->tdb, key);
release_print_db(pdb);
if (!data.dptr || data.dsize != sizeof(pid_t)) {
SAFE_FREE(data.dptr);
@@ -1225,7 +1225,7 @@ static TDB_DATA get_jobs_added_data(struct tdb_print_db *pdb)
ZERO_STRUCT(data);
- data = tdb_fetch(pdb->tdb, string_tdb_data("INFO/jobs_added"));
+ data = tdb_fetch_compat(pdb->tdb, string_tdb_data("INFO/jobs_added"));
if (data.dptr == NULL || data.dsize == 0 || (data.dsize % 4 != 0)) {
SAFE_FREE(data.dptr);
ZERO_STRUCT(data);
@@ -2139,7 +2139,7 @@ static bool remove_from_jobs_added(const char* sharename, uint32 jobid)
gotlock = True;
- data = tdb_fetch(pdb->tdb, key);
+ data = tdb_fetch_compat(pdb->tdb, key);
if (data.dptr == NULL || data.dsize == 0 || (data.dsize % 4 != 0))
goto out;
@@ -2502,7 +2502,7 @@ static int get_queue_status(const char* sharename, print_status_struct *status)
if (status) {
fstr_sprintf(keystr, "STATUS/%s", sharename);
- data = tdb_fetch(pdb->tdb, string_tdb_data(keystr));
+ data = tdb_fetch_compat(pdb->tdb, string_tdb_data(keystr));
if (data.dptr) {
if (data.dsize == sizeof(print_status_struct))
/* this memcpy is ok since the status struct was
@@ -3038,18 +3038,18 @@ static bool get_stored_queue_info(struct messaging_context *msg_ctx,
ZERO_STRUCT(cgdata);
/* Get the stored queue data. */
- data = tdb_fetch(pdb->tdb, string_tdb_data("INFO/linear_queue_array"));
+ data = tdb_fetch_compat(pdb->tdb, string_tdb_data("INFO/linear_queue_array"));
if (data.dptr && data.dsize >= sizeof(qcount))
len += tdb_unpack(data.dptr + len, data.dsize - len, "d", &qcount);
/* Get the added jobs list. */
- cgdata = tdb_fetch(pdb->tdb, string_tdb_data("INFO/jobs_added"));
+ cgdata = tdb_fetch_compat(pdb->tdb, string_tdb_data("INFO/jobs_added"));
if (cgdata.dptr != NULL && (cgdata.dsize % 4 == 0))
extra_count = cgdata.dsize/4;
/* Get the changed jobs list. */
- jcdata = tdb_fetch(pdb->tdb, string_tdb_data("INFO/jobs_changed"));
+ jcdata = tdb_fetch_compat(pdb->tdb, string_tdb_data("INFO/jobs_changed"));
if (jcdata.dptr != NULL && (jcdata.dsize % 4 == 0))
changed_count = jcdata.dsize / 4;
@@ -3216,7 +3216,7 @@ int print_queue_status(struct messaging_context *msg_ctx, int snum,
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
key = string_tdb_data(keystr);
- data = tdb_fetch(pdb->tdb, key);
+ data = tdb_fetch_compat(pdb->tdb, key);
if (data.dptr) {
if (data.dsize == sizeof(*status)) {
/* this memcpy is ok since the status struct was
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index 3435e315b43..64e3cbee0f6 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -95,7 +95,7 @@ uint32 reg_perfcount_get_base_index(void)
and so on.
So last_counter becomes num_counters*2, and last_help will be last_counter+1 */
kbuf = string_tdb_data(key);
- dbuf = tdb_fetch(names, kbuf);
+ dbuf = tdb_fetch_compat(names, kbuf);
if(dbuf.dptr == NULL)
{
DEBUG(1, ("reg_perfcount_get_base_index: failed to find key \'1\' in [%s].\n", fname));
@@ -162,7 +162,7 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
memset(temp, 0, sizeof(temp));
snprintf(temp, sizeof(temp), "%d", keyval);
kbuf = string_tdb_data(temp);
- dbuf = tdb_fetch(tdb, kbuf);
+ dbuf = tdb_fetch_compat(tdb, kbuf);
if(dbuf.dptr == NULL)
{
/* If a key isn't there, just bypass it -- this really shouldn't
@@ -347,7 +347,7 @@ static uint32 _reg_perfcount_get_numinst(int objInd, TDB_CONTEXT *names)
char buf[PERFCOUNT_MAX_LEN];
_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, objInd, "inst");
- data = tdb_fetch(names, key);
+ data = tdb_fetch_compat(names, key);
if(data.dptr == NULL)
return (uint32)PERF_NO_INSTANCES;
@@ -421,7 +421,7 @@ static bool _reg_perfcount_get_counter_data(TDB_DATA key, TDB_DATA *data)
return False;
}
- *data = tdb_fetch(counters, key);
+ *data = tdb_fetch_compat(counters, key);
tdb_close(counters);
@@ -488,7 +488,7 @@ static bool _reg_perfcount_get_counter_info(struct PERF_DATA_BLOCK *block,
padding = 0;
_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, CounterIndex, "type");
- data = tdb_fetch(names, key);
+ data = tdb_fetch_compat(names, key);
if(data.dptr == NULL)
{
DEBUG(3, ("_reg_perfcount_get_counter_info: No type data for counter [%d].\n", CounterIndex));
@@ -701,7 +701,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
memset(temp, 0, PERFCOUNT_MAX_LEN);
snprintf(temp, PERFCOUNT_MAX_LEN, "i%dname", instId);
_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, obj->ObjectNameTitleIndex, temp);
- data = tdb_fetch(names, key);
+ data = tdb_fetch_compat(names, key);
if(data.dptr == NULL)
{
/* Not actually an error, but possibly unintended? -- just logging FYI */
@@ -793,7 +793,7 @@ static int _reg_perfcount_assemble_global(struct PERF_DATA_BLOCK *block,
{
j = i*2;
_reg_perfcount_make_key(&key, keybuf, PERFCOUNT_MAX_LEN, j, "rel");
- data = tdb_fetch(names, key);
+ data = tdb_fetch_compat(names, key);
if(data.dptr != NULL)
{
if(_reg_perfcount_isparent(data))
@@ -831,7 +831,7 @@ static bool _reg_perfcount_get_64(uint64_t *retval,
_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, key_part1, key_part2);
- data = tdb_fetch(tdb, key);
+ data = tdb_fetch_compat(tdb, key);
if(data.dptr == NULL)
{
DEBUG(3,("_reg_perfcount_get_64: No data found for key [%s].\n", key.dptr));
diff --git a/source3/utils/net_printing.c b/source3/utils/net_printing.c
index 3e70f1a86f5..bfab0dc995a 100644
--- a/source3/utils/net_printing.c
+++ b/source3/utils/net_printing.c
@@ -180,7 +180,7 @@ static int net_printing_dump(struct net_context *c, int argc,
kbuf.dptr;
newkey = tdb_nextkey(tdb, kbuf), free(kbuf.dptr), kbuf=newkey)
{
- dbuf = tdb_fetch(tdb, kbuf);
+ dbuf = tdb_fetch_compat(tdb, kbuf);
if (!dbuf.dptr) {
continue;
}
@@ -656,7 +656,7 @@ static NTSTATUS printing_migrate_internal(struct net_context *c,
kbuf.dptr;
newkey = tdb_nextkey(tdb, kbuf), free(kbuf.dptr), kbuf = newkey)
{
- dbuf = tdb_fetch(tdb, kbuf);
+ dbuf = tdb_fetch_compat(tdb, kbuf);
if (!dbuf.dptr) {
continue;
}
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 1c4f5bd701f..daea4e866a6 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -638,7 +638,7 @@ static struct cache_entry *wcache_fetch_raw(char *kstr)
TDB_DATA key;
key = string_tdb_data(kstr);
- data = tdb_fetch(wcache->tdb, key);
+ data = tdb_fetch_compat(wcache->tdb, key);
if (!data.dptr) {
/* a cache miss */
return NULL;
@@ -1271,7 +1271,7 @@ NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct
fstr_sprintf(key_str, "CRED/%s", sid_to_fstring(tmp, sid));
- data = tdb_fetch(cache->tdb, string_tdb_data(key_str));
+ data = tdb_fetch_compat(cache->tdb, string_tdb_data(key_str));
if (!data.dptr) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
@@ -3394,7 +3394,7 @@ NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const
TDB_DATA data;
time_t t;
- data = tdb_fetch(cache->tdb, string_tdb_data(cred->name));
+ data = tdb_fetch_compat(cache->tdb, string_tdb_data(cred->name));
if (!data.dptr) {
DEBUG(10,("wcache_remove_oldest_cached_creds: entry for [%s] not found\n",
cred->name));
@@ -4437,7 +4437,7 @@ bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_do
if ( !key.dptr )
return false;
- data = tdb_fetch( wcache->tdb, key );
+ data = tdb_fetch_compat( wcache->tdb, key );
SAFE_FREE( key.dptr );
@@ -4782,7 +4782,7 @@ bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
if (!wcache_ndr_key(talloc_tos(), domain->name, opnum, req, &key)) {
return false;
}
- data = tdb_fetch(wcache->tdb, key);
+ data = tdb_fetch_compat(wcache->tdb, key);
TALLOC_FREE(key.dptr);
if (data.dptr == NULL) {
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 02e4acbbdef..45e747379f3 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -155,7 +155,7 @@ static int ltdb_dn_list_load(struct ldb_module *module,
key.dptr = discard_const_p(unsigned char, ldb_dn_get_linearized(dn));
key.dsize = strlen((char *)key.dptr);
- rec = tdb_fetch(ltdb->idxptr->itdb, key);
+ rec = tdb_fetch_compat(ltdb->idxptr->itdb, key);
if (rec.dptr == NULL) {
goto normal_index;
}
@@ -270,7 +270,7 @@ static int ltdb_dn_list_store(struct ldb_module *module, struct ldb_dn *dn,
key.dptr = discard_const_p(unsigned char, ldb_dn_get_linearized(dn));
key.dsize = strlen((char *)key.dptr);
- rec = tdb_fetch(ltdb->idxptr->itdb, key);
+ rec = tdb_fetch_compat(ltdb->idxptr->itdb, key);
if (rec.dptr != NULL) {
list2 = ltdb_index_idxptr(module, rec, false);
if (list2 == NULL) {
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index a49751de154..30364897d9e 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -32,6 +32,7 @@
*/
#include "ldb_tdb.h"
+#include <lib/tdb_compat/tdb_compat.h>
/*
add one element to a message
@@ -223,7 +224,7 @@ static int ltdb_search_base(struct ldb_module *module, struct ldb_dn *dn)
return LDB_ERR_OPERATIONS_ERROR;
}
- tdb_data = tdb_fetch(ltdb->tdb, tdb_key);
+ tdb_data = tdb_fetch_compat(ltdb->tdb, tdb_key);
talloc_free(tdb_key.dptr);
if (!tdb_data.dptr) {
return LDB_ERR_NO_SUCH_OBJECT;
@@ -255,7 +256,7 @@ int ltdb_search_dn1(struct ldb_module *module, struct ldb_dn *dn, struct ldb_mes
return LDB_ERR_OPERATIONS_ERROR;
}
- tdb_data = tdb_fetch(ltdb->tdb, tdb_key);
+ tdb_data = tdb_fetch_compat(ltdb->tdb, tdb_key);
talloc_free(tdb_key.dptr);
if (!tdb_data.dptr) {
return LDB_ERR_NO_SUCH_OBJECT;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 2f7f2220860..77a75a45045 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -50,6 +50,7 @@
*/
#include "ldb_tdb.h"
+#include <lib/tdb_compat/tdb_compat.h>
/*
@@ -653,7 +654,7 @@ int ltdb_modify_internal(struct ldb_module *module,
return LDB_ERR_OTHER;
}
- tdb_data = tdb_fetch(ltdb->tdb, tdb_key);
+ tdb_data = tdb_fetch_compat(ltdb->tdb, tdb_key);
if (!tdb_data.dptr) {
talloc_free(tdb_key.dptr);
return ltdb_err_map(tdb_error(ltdb->tdb));
diff --git a/source4/ntvfs/common/brlock_tdb.c b/source4/ntvfs/common/brlock_tdb.c
index 885eda98cda..817448377cf 100644
--- a/source4/ntvfs/common/brlock_tdb.c
+++ b/source4/ntvfs/common/brlock_tdb.c
@@ -333,7 +333,7 @@ static NTSTATUS brl_tdb_lock(struct brl_context *brl,
}
}
- dbuf = tdb_fetch(brl->w->tdb, kbuf);
+ dbuf = tdb_fetch_compat(brl->w->tdb, kbuf);
lock.context.smbpid = smbpid;
lock.context.server = brl->server;
@@ -468,7 +468,7 @@ static NTSTATUS brl_tdb_unlock(struct brl_context *brl,
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- dbuf = tdb_fetch(brl->w->tdb, kbuf);
+ dbuf = tdb_fetch_compat(brl->w->tdb, kbuf);
if (!dbuf.dptr) {
tdb_chainunlock(brl->w->tdb, kbuf);
return NT_STATUS_RANGE_NOT_LOCKED;
@@ -568,7 +568,7 @@ static NTSTATUS brl_tdb_remove_pending(struct brl_context *brl,
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- dbuf = tdb_fetch(brl->w->tdb, kbuf);
+ dbuf = tdb_fetch_compat(brl->w->tdb, kbuf);
if (!dbuf.dptr) {
tdb_chainunlock(brl->w->tdb, kbuf);
return NT_STATUS_RANGE_NOT_LOCKED;
@@ -639,7 +639,7 @@ static NTSTATUS brl_tdb_locktest(struct brl_context *brl,
return NT_STATUS_INVALID_LOCK_RANGE;
}
- dbuf = tdb_fetch(brl->w->tdb, kbuf);
+ dbuf = tdb_fetch_compat(brl->w->tdb, kbuf);
if (dbuf.dptr == NULL) {
return NT_STATUS_OK;
}
@@ -686,7 +686,7 @@ static NTSTATUS brl_tdb_close(struct brl_context *brl,
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- dbuf = tdb_fetch(brl->w->tdb, kbuf);
+ dbuf = tdb_fetch_compat(brl->w->tdb, kbuf);
if (!dbuf.dptr) {
tdb_chainunlock(brl->w->tdb, kbuf);
return NT_STATUS_OK;
@@ -751,7 +751,7 @@ static NTSTATUS brl_tdb_count(struct brl_context *brl, struct brl_handle *brlh,
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- dbuf = tdb_fetch(brl->w->tdb, kbuf);
+ dbuf = tdb_fetch_compat(brl->w->tdb, kbuf);
if (!dbuf.dptr) {
tdb_chainunlock(brl->w->tdb, kbuf);
return NT_STATUS_OK;
diff --git a/source4/ntvfs/common/opendb_tdb.c b/source4/ntvfs/common/opendb_tdb.c
index 851d8382039..9884e1f8b0d 100644
--- a/source4/ntvfs/common/opendb_tdb.c
+++ b/source4/ntvfs/common/opendb_tdb.c
@@ -238,7 +238,7 @@ static NTSTATUS odb_pull_record(struct odb_lock *lck, struct opendb_file *file)
DATA_BLOB blob;
enum ndr_err_code ndr_err;
- dbuf = tdb_fetch(odb->w->tdb, lck->key);
+ dbuf = tdb_fetch_compat(odb->w->tdb, lck->key);
if (dbuf.dptr == NULL) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
diff --git a/source4/ntvfs/posix/xattr_tdb.c b/source4/ntvfs/posix/xattr_tdb.c
index a2e8111dedb..c325561562d 100644
--- a/source4/ntvfs/posix/xattr_tdb.c
+++ b/source4/ntvfs/posix/xattr_tdb.c
@@ -129,7 +129,7 @@ NTSTATUS pull_xattr_blob_tdb_raw(struct tdb_wrap *ea_tdb,
return status;
}
- tdata = tdb_fetch(ea_tdb->tdb, tkey);
+ tdata = tdb_fetch_compat(ea_tdb->tdb, tkey);
if (tdata.dptr == NULL) {
return NT_STATUS_NOT_FOUND;
}
diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c
index 92deb4f8180..614a9b52ae9 100644
--- a/source4/torture/local/dbspeed.c
+++ b/source4/torture/local/dbspeed.c
@@ -97,7 +97,7 @@ static bool test_tdb_speed(struct torture_context *torture, const void *_data)
i = random() % torture_entries;
key.dptr = (uint8_t *)talloc_asprintf(tmp_ctx, "S-1-5-21-53173311-3623041448-2049097239-%u", i);
key.dsize = strlen((char *)key.dptr)+1;
- data = tdb_fetch(tdbw->tdb, key);
+ data = tdb_fetch_compat(tdbw->tdb, key);
talloc_free(key.dptr);
if (data.dptr == NULL) {
torture_result(torture, TORTURE_FAIL, "Failed to find SID %d!", i);
@@ -106,7 +106,7 @@ static bool test_tdb_speed(struct torture_context *torture, const void *_data)
free(data.dptr);
key.dptr = (uint8_t *)talloc_asprintf(tmp_ctx, "UID %u", i);
key.dsize = strlen((char *)key.dptr)+1;
- data = tdb_fetch(tdbw->tdb, key);
+ data = tdb_fetch_compat(tdbw->tdb, key);
talloc_free(key.dptr);
if (data.dptr == NULL) {
torture_result(torture, TORTURE_FAIL, "Failed to find UID %d!", i);