[MERGE] use a serial number and one random value for fileids

Robert Collins robertc at robertcollins.net
Fri May 19 05:09:22 BST 2006


On Thu, 2006-05-18 at 23:22 -0400, Aaron Bentley wrote:
> Robert Collins wrote:
> > This patch uses a serial number and a single random value for 'bzr add'
> > rather than brand new randomness each time.
> 
> > The only hole I can see is someone doing fork() after calling add, and
> > then calling add in the child. We probably should add an atfork hook to
> > reset the seed in this case.
> 
> Did you consider just doing it in Tree.add?  That seems even safer and 
> more transparent to me.

I assume by 'it' you mean caching the random prefix. Yes, I considered
it, but currently smart_add does not use WorkingTree.add or Tree.add.
And even if they did, and it was in Foo.add, it still is susceptible to
a fork() + add from each child conflict.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060519/5dbfb3b5/attachment.pgp 


More information about the bazaar mailing list