tdbsam serious problem when migrating from 3.0.32 to 3.3.2
Jeremy Allison
jra at samba.org
Wed Mar 18 15:14:15 GMT 2009
On Wed, Mar 18, 2009 at 09:07:51AM +0300, Alexander Zagrebin wrote:
> > Is the tdb_modify failing with record not found here ?
>
> The sequence is:
>
> 1. tdb_sam_convert_one (source/passdb/pdb_tdb.c) calls rec->store
> rec->store is db_tdb_store for the tdb backend
> 2. db_tdb_store (source/lib/dbwrap_tdb.c:179) calls tdb_store
> 3. tdb_store (source/lib/tdb/common/tdb.c:427) calls tdb->hash_fn ==
> default_tdb_hash.
> At this point we have the "invalid" hash.
> Now tdb_update_hash is called with flag TDB_MODIFY
> 4. tdb_update_hash (source/lib/tdb/common/tdb.c:122) calls tdb_find
> 5. tdb_find (source/lib/tdb/common/tdb.c:78) calls tdb_ofs_read with offset,
> calculated
> from "invalid" hash.
> 6. Further we have the sequence of calls
> tdb_ofs_read (io.c) - transaction_read (transaction.c), which returns the
> data
> from incorrect offset, due to invalid hash.
> At my case this is 0.
>
> So tdb_find returns TDB_ERRCODE(TDB_ERR_NOEXIST, 0), and this error leads to
> failure
>
> I have patched default_tdb_hash (source/lib/tdb/common/open.c)
> to revert to the previous (3.0.*) behavior:
Yeah, unfortunately I can't do that, as there are too
many 3.2.x and 3.3.x systems out there running with
the new behavior. I can add in the workaround I proposed
to the upgrade code path in smbd, so other users won't have
to do what you ended up doing manually, and I'll do that today.
Thanks !
Jeremy.
More information about the samba-technical
mailing list