dealing with chain loops in TDB

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Jul 23 21:46:10 GMT 2008


On Wed, Jul 23, 2008 at 11:49:21AM -0700, James Peach wrote:
> Hi all,
> 
> I have a customer who is running Samba 3.0.25b (+ patches) and has a  
> gencache.tdb with a loop in one of the hash chains.
> 
> I modified "tdbtool list" to detect the loop using the tortoise and  
> hare algorithm, but there are an awful lot of places that walk the  
> record list, so I'm loth to do this in every place.

Is there really that many? I thought there's really only a
few. I had once written a patch that limits the number of
chain entries to a million or so, and then returns. This
patch however was left unreviewed, so I did not put it in.

> Anyway, even if I detect the loop in every place, what is the right  
> way to deal with it? I can see at least 3 options:
> 	1. break the loop by setting the next offset to 0
> 	2. breaking the loop by marking the record as dead
> 	3. just bail and leave it alone

My patch did #3. I doubt that you can make a reasonable
guess how to fix the lists once you have a corrupt tdb.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20080723/28f59331/attachment.bin


More information about the samba-technical mailing list