tdb_fetch_compat: use instead of tdb_fetch.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:10:31 +0000 (18:40 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Jun 2011 09:18:35 +0000 (11:18 +0200)
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
20 files changed:
lib/util/util_tdb.c
source3/lib/dbwrap_ctdb.c
source3/lib/eventlog/eventlog.c
source3/lib/gencache.c
source3/lib/messages_local.c
source3/libsmb/smb_share_modes.c
source3/nmbd/nmbd_winsserver.c
source3/printing/nt_printing_migrate.c
source3/printing/nt_printing_tdb.c
source3/printing/printing.c
source3/registry/reg_perfcount.c
source3/utils/net_printing.c
source3/winbindd/winbindd_cache.c
source4/lib/ldb/ldb_tdb/ldb_index.c
source4/lib/ldb/ldb_tdb/ldb_search.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/ntvfs/common/brlock_tdb.c
source4/ntvfs/common/opendb_tdb.c
source4/ntvfs/posix/xattr_tdb.c
source4/torture/local/dbspeed.c

index 33615854bd8f97a32e6cea06499767d4f66610ef..2dd5f9dd5fe5d196277607e7b216ff4b5e5c3681 100644 (file)
@@ -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);
 }
 
 /****************************************************************************
index 935bb03f34c17f50947801bf1f540db57f04bd50..45c134cf803a765d62513cd933f4e3d89cf950b9 100644 (file)
@@ -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
index 556938fe1d07f6edb1835737d14adbbb8c67dd19..b719c6f7f8c15cf948f15e94c68d8422e5b97e5f 100644 (file)
@@ -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",
index 8d4861a176936b740d01e4dec1748dc5cf5f1014..5e1547282972d8e7d79b82c1711e26651b4db60f 100644 (file)
@@ -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);
index 09b8706262127235edc1d5f1d4c548f06cf57827..d7f370c9e488ccb8f27042bfa304ecfb969792d6 100644 (file)
@@ -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;
index bb405969f37ffb89cdb3b363afe46c8cb63eaeb8..2bf430dfea58f7c705b581976dc89e44b17deafd 100644 (file)
@@ -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 ! */
        }
index 1370535b7cdc00504c184cb5bbc77a81e205529e..50cdc0acf93ecc1dc49627cb08ed5ff1b4e4f288 100644 (file)
@@ -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;
index 03992432bfba28d3dc2b988f9a344afb0a786242..f6c4ef2d8b680cc1b1c3c0485d24e31faf57a574 100644 (file)
@@ -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;
                }
index 3c4c661b11c5fcb9f53a2170079d20fbd14468c5..e5ae59081b30819dea977462bf84726fcd6c8032 100644 (file)
@@ -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"));
index f15bd4f754a435928e4eecfd4a4921220a2e50b8..2e5dbcfab243682f79637637e73f059bacfc7a3d 100644 (file)
@@ -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
index 3435e315b439f35c20229590950415add0e8a6e8..64e3cbee0f686e7412b301803b9d69f1b14f9781 100644 (file)
@@ -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));
index 3e70f1a86f599a5fadb1946c02a0d1438045b9d9..bfab0dc995ad9f5dde46cac1fc30bffdcae69d6e 100644 (file)
@@ -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;
                }
index 1c4f5bd701f9eea641c41171d95f235d20af5524..daea4e866a66d40560b97f2de61e088aac8940d1 100644 (file)
@@ -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) {
index 02e4acbbdef9ecd0e89da7d20de026a6a1ad8895..45e747379f364668d0e8ab59febad359631f2a6b 100644 (file)
@@ -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) {
index a49751de154574bc7c0b6f1f7fdc11e0404469c3..30364897d9e5ecb39938080844cb7d9a04e8d4f0 100644 (file)
@@ -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;
index 2f7f22208607741e534380671cb428bac17eb289..77a75a45045b933fcfebaea2a0ea802cd614c038 100644 (file)
@@ -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));
index 885eda98cda998828e360d242ad95c4a38e36ad0..817448377cfab4a5408f0dc5b33c339441b287c5 100644 (file)
@@ -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;
index 851d8382039d951798213ac40d2aae0778ce4e65..9884e1f8b0d9a78e6647e50f16832735c49f8243 100644 (file)
@@ -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;
        }
index a2e8111dedb8dcee5361ca56b040cdc624aa1703..c325561562df784731d57c5860a68ff7fb9c44eb 100644 (file)
@@ -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;
        }
index 92deb4f8180f5d648a7472ae6b064b7a9dcd138b..614a9b52ae9b8a544143b7774cf2cd780820176d 100644 (file)
@@ -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);